diff --git a/.gitignore b/.gitignore index 21b0563..d1095ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /devcontainer +/devcontainerx /dist \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 7758fb6..2c94438 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ builds: - env: - CGO_ENABLED=0 - binary: devcontainer + binary: devcontainerx goos: - linux - darwin @@ -9,7 +9,7 @@ builds: goarch: - 386 - amd64 - main: ./cmd/devcontainer/ + main: ./cmd/devcontainerx/ ldflags: - -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X "main.goversion={{.Env.GOVERSION}}" @@ -29,9 +29,9 @@ brews: homepage: https://github.com/stuartleeks/devcontainer-cli description: CLI for working with Visual Studio Code devcontainers install: | - bin.install "devcontainer" + bin.install "devcontainerx" test: | - system "#{bin}/devcontainer --version" + system "#{bin}/devcontainerx --version" changelog: sort: asc diff --git a/Makefile b/Makefile index 7b44604..5725a73 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ help: ## show this help build: fmt ## Build devcontainer cli - go build ./cmd/devcontainer + go build ./cmd/devcontainerx lint: build ## Build and lint golangci-lint run diff --git a/README.md b/README.md index b10a7d3..374bf19 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,13 @@ devcontainer-cli is the start of a CLI to improve the experience of working with **Status: this is a pet project that I've been experimenting with. It is not supported and you should expect bugs :-)** +**NOTE: To avoid conflicts with the [official CLI](https://github.com/devcontainers/cli) the binary for this project has been renamed to `devcontainerx`** + ## Installation Head to the [latest release page](https://github.com/stuartleeks/devcontainer-cli/releases/latest) and download the archive for your platform. -Extract `devcontainer` from the archive and place in a folder in your `PATH`. +Extract `devcontainerx` from the archive and place in a folder in your `PATH`. You can also install using `homebrew` with `brew install stuartleeks/tap/devcontainer` @@ -27,16 +29,16 @@ sudo -E ./install.sh To enable bash completion, add the following to you `~/.bashrc` file: ```bash -source <(devcontainer completion bash) +source <(devcontainerx completion bash) ``` -Or to alias `devcontainer` (to `dc` in this example): +Or to alias `devcontainerx` (to `dcx` in this example): ```bash -alias dc=devcontainer -complete -F __start_devcontainer dc +alias dcx=devcontainerx +complete -F __start_devcontainerx dcx ``` ## Docs -See [the documentation](https://stuartleeks.github.io/devcontainer-cli) on how to work with `devcontainer`. +See [the documentation](https://stuartleeks.github.io/devcontainer-cli) on how to work with `devcontainerx`. diff --git a/cmd/devcontainer/completion.go b/cmd/devcontainerx/completion.go similarity index 87% rename from cmd/devcontainer/completion.go rename to cmd/devcontainerx/completion.go index bc06e1a..25dfc2f 100644 --- a/cmd/devcontainer/completion.go +++ b/cmd/devcontainerx/completion.go @@ -14,18 +14,18 @@ func createCompleteCommand(rootCmd *cobra.Command) *cobra.Command { Short: "Generates bash completion scripts", Long: `To load completion run - . <(devcontainer completion SHELL) + . <(devcontainerx completion SHELL) Valid values for SHELL are : bash, fish, powershell, zsh For example, to configure your bash shell to load completions for each session add to your bashrc # ~/.bashrc or ~/.profile - source <(devcontainer completion) + source <(devcontainerx completion) # if you want to alias the CLI: - alias dc=devcontainer - source <(devcontainer completion bash | sed s/devcontainer/dc/g) + alias dcx=devcontainerx + source <(devcontainerx completion bash | sed s/devcontainerx/dcx/g) `, PersistentPreRun: func(cmd *cobra.Command, args []string) { diff --git a/cmd/devcontainer/config.go b/cmd/devcontainerx/config.go similarity index 100% rename from cmd/devcontainer/config.go rename to cmd/devcontainerx/config.go diff --git a/cmd/devcontainer/devcontainer.go b/cmd/devcontainerx/devcontainer.go similarity index 100% rename from cmd/devcontainer/devcontainer.go rename to cmd/devcontainerx/devcontainer.go diff --git a/cmd/devcontainer/main.go b/cmd/devcontainerx/main.go similarity index 97% rename from cmd/devcontainer/main.go rename to cmd/devcontainerx/main.go index aa32ec9..c865f4c 100644 --- a/cmd/devcontainer/main.go +++ b/cmd/devcontainerx/main.go @@ -17,7 +17,7 @@ var ( func main() { rootCmd := &cobra.Command{ - Use: "devcontainer", + Use: "devcontainerx", PersistentPreRun: func(cmd *cobra.Command, args []string) { update.PeriodicCheckForUpdate(version) }, diff --git a/cmd/devcontainer/openincode.go b/cmd/devcontainerx/openincode.go similarity index 100% rename from cmd/devcontainer/openincode.go rename to cmd/devcontainerx/openincode.go diff --git a/cmd/devcontainer/snippet.go b/cmd/devcontainerx/snippet.go similarity index 100% rename from cmd/devcontainer/snippet.go rename to cmd/devcontainerx/snippet.go diff --git a/cmd/devcontainer/template.go b/cmd/devcontainerx/template.go similarity index 100% rename from cmd/devcontainer/template.go rename to cmd/devcontainerx/template.go diff --git a/cmd/devcontainer/update.go b/cmd/devcontainerx/update.go similarity index 100% rename from cmd/devcontainer/update.go rename to cmd/devcontainerx/update.go diff --git a/cmd/devcontainer/version.go b/cmd/devcontainerx/version.go similarity index 100% rename from cmd/devcontainer/version.go rename to cmd/devcontainerx/version.go diff --git a/scripts/install.sh b/scripts/install.sh index fd0ef61..12960be 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -20,5 +20,5 @@ LATEST_VERSION=$(curl --silent "https://api.github.com/repos/stuartleeks/devcont echo $LATEST_VERSION mkdir -p ~/bin wget https://github.com/stuartleeks/devcontainer-cli/releases/download/${LATEST_VERSION}/devcontainer-cli_${OS}_${ARCH}.tar.gz -tar -C ~/bin -zxvf devcontainer-cli_${OS}_${ARCH}.tar.gz devcontainer -chmod +x ~/bin/devcontainer +tar -C ~/bin -zxvf devcontainer-cli_${OS}_${ARCH}.tar.gz devcontainerx +chmod +x ~/bin/devcontainerx