Azure / Azure/static-web-apps-cli
Inconsistent path formation when using swaConfigLocation
- 主要言語
- TypeScript
- スター
- 668
- フォーク
- 156
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**swaConfigLocation** doesn't seem to be building the path to the configuration file properly. I have placed both SWA and SWA CLI configuration files on the folder `my-folder`, and run
`swa deploy --config my-folder/swa-cli.config.json`
_swa-cli.config.json_ has a `deploy` section with the property `swaConfigLocation`.
If I set `"swaConfigLocation": "."` or `"swaConfigLocation": "./"` then I get the error `ENOENT: no such file or directory` because it tries to find the file at `\staticwebapp.config.json` instead of `\my-folder\staticwebapp.config.json`. That is, it is using the parent folder instead of `my-folder`. **This was not the case in earlier versions of SWA CLI**.
If I set `"swaConfigLocation": "my-folder"` or `"swaConfigLocation": "./my-folder"` then I get an `ENOENT: no such file or directory` error because it tries to find the file at `\my-folder\my-folder`. On this occasion, swaConfigLocation is appended to `my-folder` instead of the parent folder (as opposed to what happens in the previous example).
If I set `"swaConfigLocation": "staticwebapp.config.json"` or `"swaConfigLocation": "./staticwebapp.config.json"`, then the path seems right `\my-folder\staticwebapp.config.json`, but I get an `ENOTDIR: not a directory` error, because it is expecting a folder rather than a file.
So there seem to be an inconsistency regarding the use of the parent vs `my-folder` directory. I am using **Windows 11** and **Azure Static Web Apps CLI 2.0.8**. In earlier versions of SWA CLI I always used `"swaConfigLocation": "."` and never had this problem.
Could you please provide some advise?
コントリビューションガイド
調査の方向性
Windows 上で `swa deploy --config my-folder/swa-cli.config.json` と、報告された各 `swaConfigLocation` 値を使って問題を再現します。CLI が構成ディレクトリをどのように解決するかを追跡し、想定される `my-folder\staticwebapp.config.json` パスが ENOENT または ENOTDIR エラーなしで正常に読み込まれることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100