cli
cli copied to clipboard
If project name is taken, sem init fails with error, leaving user without next steps
$ sem init
error: http status 422 with message "{"message":"project name \"project-name\" is already taken"}" received from upstream
so what to do next...?
proposal 1 (help message)
$ sem init
error: project name "project-name" is taken
Set up project with an alternative name with: sem init --project-name [NAME].
pros: clean, no ugly names, prevents accidental duplicate projects cons: it requires more typing, and reading the output
proposal 2 (automatic alternative name)
$ sem init
Project `project-name-2` created. Run your first pipeline with:
git add .semaphore/sem....
pros: fast cons: Maybe I don't want to create this project again if it is already registered. I need to manually change project name from project-name-1, to something I like.
I vote for (proposal 1), it is cleaner, and more predictable in scripts.
I'd also go with no. 1 but also add a second suggestion to delete the old project. In my case I simply forgot that it exists, so I did that...
Suggestions:
- Set up a project with another name:
sem init --project-name [NAME]
- Delete the existing project and try again:
sem delete project typed-name