Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ A CLI for [Deploio](https://www.deplo.io/) that wraps [`nctl`](https://github.co
```bash
git clone https://github.com/renuo/deploio-cli.git
cd deploio-cli
bundle install
bundle exec bin/deploio --help
bin/setup
```

`bin/setup` installs the dependencies and puts `deploio` and `depl` binstubs into `~/.local/bin` (override with `INSTALL_DIR`), so this checkout runs from any directory.
The binstubs are pinned to the Ruby that ran `bin/setup`; run it again after changing the Ruby version.

### As a gem

```bash
Expand Down Expand Up @@ -227,21 +229,14 @@ gem build deploio-cli.gemspec

### Testing commands

The best way to test the commands in the shell is to temporarly set:

```shell
export PATH="$PWD/bin:$PATH"
```

to have the `deploio` command binded to the current one, and
After `bin/setup`, `deploio` runs this checkout, so changes take effect immediately.
After adding or changing commands or options, refresh the autocompletion options:

```shell
eval "$(deploio completion)" # zsh
eval "$(deploio completion --shell bash)" # bash
```

to refresh the autocompletion options.

## License

MIT
Expand Down
20 changes: 20 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."
bundle install

bin_dir="${INSTALL_DIR:-$HOME/.local/bin}"
mkdir -p "$bin_dir"
# Pinned to this Ruby, so the binstub also works where a version manager selects another one
BUNDLE_BIN="$bin_dir" bundle binstubs deploio-cli --force --shebang "$(ruby -e 'print RbConfig.ruby')"
ln -sf deploio "$bin_dir/depl"
echo "Installed deploio and depl into $bin_dir"

case ":$PATH:" in
*":$bin_dir:"*) ;;
*) echo "Add $bin_dir to your PATH" ;;
esac

echo 'Enable completion in ~/.bashrc: eval "$(deploio completion --shell bash)"'
echo 'Enable completion in ~/.zshrc: eval "$(deploio completion)"'
115 changes: 0 additions & 115 deletions setup

This file was deleted.

Loading