Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 30 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Executable
Unpack the archive relevant to your machine and place in $PATH

## Shell Completion Scripts

### Bash

mkdir -p ~/.config/exercism
mv ./exercism_completion.bash ~/.config/exercism/exercism\exercism_completion.bash

Load the completion in your `.bashrc`, `.bash_profile` or `.profile` by
adding the following snippet:

if [ -f ~/.config/exercism/exercism_completion.bash ]; then
source ~/.config/exercism/exercism_completion.bash
fi

### Zsh

mkdir -p ~/.config/exercism
mv ./exercism_completion.zsh ~/.config/exercism/exercism_completion.zsh

Load up the completion in your `.zshrc`, `.zsh_profile` or `.profile` by adding
the following snippet

if [ -f ~/.config/exercism/exercism_completion.zsh ]; then
source ~/.config/exercism/exercism_completion.zsh
fi

**Note:** If you are using the popular [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) framework to manage your zsh plugins, you don't need to add the above snippet, all you need to do is create a file `exercism_completion.zsh` inside the `~/.oh-my-zsh/custom`.
17 changes: 15 additions & 2 deletions bin/build-all
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ ARMVAR=github.com/exercism/cli/cmd.BuildARM
# handle alternate binary name for pre-releases
BINNAME=${NAME:-exercism}

get_shell_completions() {
SHELLCOMP_BASEURL=http://cli.exercism.io/shell/exercism_completion
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the scripts in this repository instead of in the static HTML repo (as you suggested). That way this will be a simple file inclusion rather than a network call.

curl -O $SHELLCOMP_BASEURL.bash -O $SHELLCOMP_BASEURL.zsh
}

cleanup() {
rm -f exercism_completion.bash exercism_completion.zsh
}

createRelease() {
os=$1
arch=$2
Expand Down Expand Up @@ -66,13 +75,15 @@ createRelease() {

if [ "$osname" = windows ]
then
zip "$relname.zip" "$binname"
zip "$relname.zip" "$binname" ../exercism_completion* ../BUILD.md
else
tar cvzf "$relname.tgz" "$binname"
tar cvzf "$relname.tgz" "$binname" ../exercism_completion* ../BUILD.md
fi
cd ..
}

get_shell_completions

# Mac Releases
createRelease darwin 386
createRelease darwin amd64
Expand Down Expand Up @@ -101,3 +112,5 @@ createRelease linux arm64
# Windows Releases
createRelease windows 386
createRelease windows amd64

cleanup