-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-content.sh
executable file
·30 lines (21 loc) · 1.22 KB
/
init-content.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# モデルのコードを生成
# 使用例: nr scaffold artist artists アーティスト
model="$1" # モデル名 例: artist
path="$2" # パス 例: artists
label="$3" # ラベル 例: アーティスト
# モデルのコードを生成
pnpm exec scaffdog generate model --answer "model:$model" --answer "path:$path" --answer "label:$label" --output "/model/" --force
# モデルのプレビューを生成
pnpm exec scaffdog generate model-preview --answer "model:$model" --output "/model/$model/components/"
# モデルのリストを生成
pnpm exec scaffdog generate model-list --answer "model:$model" --output "/model/$model/components/"
# モデルのフォーム&プレビューを生成
pnpm exec scaffdog generate model-form-with-preview --answer "model:$model" --answer "label:$label" --output "/model/$model/components/"
# モデルのページを生成
pnpm exec scaffdog generate model-page --answer "model:$model" --answer "path:$path" --answer "label:$label" --output "/app/"
# コードフォーマット
nr lint -- "./src/model/$model"
nr lint -- "./src/app/(general)/$path"
# コード生成の完了メッセージを表示
echo "✨ Code generation completed for model: $model, path: $path, label: $label"