Azure / Azure/static-web-apps-cli

Colon in `swa-cli.config.json` `configuration.run` value causing field to not be read

Aperta
#782 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
command: start type: bug version: ga
Lingua principale
TypeScript
Stelle
668
Fork
156
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).

``` pwsh
swa -v
1.1.6
```

**Are you accessing the CLI from the default port `:4280` ?**

- [ ] ~No, I am using a different port number (`--port`) and accessing the CLI from that port~
- [ ] ~Yes, I am accessing the CLI from port `:4280`~
- [x] N/A

> Make sure you are accessing the URL printed in the console when running `swa start`!

**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**

**Describe the bug**

`configuration.run` value does not seem to be picked up correctly if the value contains a colon (`:`)

**To Reproduce**

I can see this in `options.run` with `--print-config` but it doesn't seem to get passed on to `SWA_CLI_STARTUP_COMMAND` when checking `-V=silly`:

I set a `run` value in `swa-cli-config.json` like this:

``` json
"run": "npm run dev:admin",
```

``` yml
- SWA_CLI_STARTUP_COMMAND:
```

If I remove the colon

``` json
"run": "npm run dev",
```

``` yml
- SWA_CLI_STARTUP_COMMAND: npm run dev
```

**Expected behavior**

I expect the value with the colon to be read om correctly

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: Windows 10
- Version 22H2

**Additional context**
I made a minimal repro here https://github.com/jag43/swa-repro
You can see the different behaviour with
``` pwsh
swa start --config-name swa-repro-colon --print-config -V=silly
```
and
``` pwsh
swa start --config-name swa-repro-no-colon --print-config -V=silly
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia eseguendo `swa start --config-name swa-repro-colon --print-config -V=silly` e confrontalo con la configurazione senza i due punti. Traccia il percorso di `configuration.run` fino a `SWA_CLI_STARTUP_COMMAND`; il lavoro è completato quando un valore come `npm run dev:admin` viene preservato e passato correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.