akashic-games / akashic-cli

Command-line utility for Akashic Engine game development
MIT License
8 stars 6 forks source link

ローカルテンプレートを指定して `akashic-init -t xxx` すると、ローカルテンプレートが削除される #1416

Open yasshi2525 opened 1 week ago

yasshi2525 commented 1 week ago

Windows環境で %USERPROFILE%\.akashic-templates ディレクトリを作成し、テンプレートに用いるファイルを live-on-air-template ディレクトリに配置した。 (live-on-air-template は自分だけが利用したいテンプレート名)

新規ディレクトリを作成し、そこで akashic init -t live-on-air-template を実行したところテンプレートファイルは意図した通り生成されたが、 %USERPROFILE%\.akashic-templates\live-on-air-template ディレクトリが削除されてしまいました。

用意したテンプレートファイル群が akashic init しても削除されないよう修正をお願いします

akashic-cli のバージョン: 2.17.22 OS: Windows 11 terminal: PowerShell と git-bash で確認

xnv commented 1 week ago

ありがとうございます。確認します。

yasshi2525 commented 1 week ago

feat(init): template.json の exclude をサポート 上記の修正時、gitからcloneした場合に削除していたのを finally で削除するようにしたため、localTemplateDirectoryからfetchTemplate()した際も削除されるようになったようです。

https://github.com/akashic-games/akashic-cli/pull/1238/files#diff-cf1ce12ac5a6746feec86176c8507fa6273bb2ff227b6c37b0d86c2933fb5037R73-R76

+   } finally {
+       if (templatePath && existsSync(templatePath)) {
+           await fs.rm(templatePath, { recursive: true });
+       }
    }

ご参考まで