Skip to content

Commit

Permalink
Updated PATH suggestions
Browse files Browse the repository at this point in the history
1. Updated the `install` function such that it suggests a check for
   the existence of `${INSTALL_PATH}/c3tk`, then specifies
   `${INSTALL_PATH}/c3tk paths`. This first part is to ensure that
   this line doesn't execute when we do `c3tk shell`, as the user's
   `$HOME` is now mounted into the container. The second part is to
   get around a chicken-egg scenario whereby `c3tk paths` requires
   `c3tk` to already be in the path.
2. Updated the README with this same strategy.
  • Loading branch information
ess committed Nov 19, 2021
1 parent 3c38a97 commit 9676fc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ curl -o - https://raw.githubusercontent.com/c3tk/c3tk/main/bin/c3tk | sudo bash
Follow the output of the instructions emitted from the install such as adding
to your `PATH:
```
grep -q c3tk ~/.profile || echo 'export PATH="$(c3tk paths):$PATH"' >> ~/.profile
grep -q c3tk ~/.profile || echo '[[ -x /opt/c3tk/bin/c3tk ]] && export PATH="$(/opt/c3tk/bin/c3tk paths):$PATH"' >> ~/.profile
```
Then open a new shell and start adding the commands you are interested in.

Expand Down
2 changes: 1 addition & 1 deletion bin/c3tk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install() {
grab_files &&
chmod +x ${INSTALL_PATH}/c3tk &&
echo "Installed \`${INSTALL_PATH}/c3tk\`" &&
echo -e "\nAdd $(paths) to your PATH:\n\n\texport PATH=\"\$(/opt/c3tk/bin/c3tk paths):\$PATH\"\n" &&
echo -e "\nAdd $(paths) to your PATH:\n\n\t[[ -x ${INSTALL_PATH}/c3tk ]] && export PATH=\"\$(${INSTALL_PATH}/c3tk paths):\$PATH\"\n" &&
exit 0
}

Expand Down

0 comments on commit 9676fc8

Please sign in to comment.