From 8e5d827cd4a2c1e0e15dc05a779804694d2f1d4a Mon Sep 17 00:00:00 2001 From: "warren.veerasingam" Date: Fri, 18 Sep 2020 13:56:27 -0500 Subject: [PATCH] added custom bin option --- README.md | 22 ++++++++++----------- www/docs/Continuous-Integration.md | 21 ++++++++++---------- www/docs/Troubleshoot.md | 31 +++++++++++++++++++++++++----- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 0514f325..5d0cc052 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ Installation for other linux operation systems. curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash ``` -### Snap for CentOS, Ubuntu, Linux Mint, RHEL, Debian, Fedora +### Snapcraft for CentOS, Ubuntu, Linux Mint, RHEL, Debian, Fedora ```sh -snap install --edge tfswitch +sudo snap install tfswitch ``` @@ -167,9 +167,9 @@ cd(){ echo "Installing tfswitch locally" wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh chmod 755 install.sh -./install.sh -b bin-directory +./install.sh -b `pwd`/.bin -./bin-directory/tfswitch +`pwd`/.bin/tfswitch ``` If you have limited permission, try: @@ -180,13 +180,13 @@ If you have limited permission, try: echo "Installing tfswitch locally" wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh chmod 755 install.sh -./install.sh -b bin-directory +./install.sh -b `pwd`/.bin -CUSTOMBIN=`pwd`/bin #set custom bin path +CUSTOMBIN=`pwd`/.bin #set custom bin path mkdir $CUSTOMBIN #create custom bin path export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment -./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7 +`pwd`/.bin/tfswitch -b $CUSTOMBIN/terraform 0.11.7 terraform -v #testing version ``` @@ -219,13 +219,13 @@ jobs: wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh chmod 755 install.sh - ./install.sh -b bin-directory + ./install.sh -b $HOME/.bin + + CUSTOMBIN=$HOME/.bin #set custom bin path - CUSTOMBIN=`pwd`/bin #set custom bin path - mkdir $CUSTOMBIN #create custom bin path export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment - ./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7 + $CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7 terraform -v #testing version ``` diff --git a/www/docs/Continuous-Integration.md b/www/docs/Continuous-Integration.md index cf9b4012..2c6830af 100644 --- a/www/docs/Continuous-Integration.md +++ b/www/docs/Continuous-Integration.md @@ -1,5 +1,5 @@ ### Jenkins setup -drawing +drawing ```sh #!/bin/bash @@ -7,10 +7,11 @@ echo "Installing tfswitch locally" wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh chmod 755 install.sh -./install.sh -b bin-directory +./install.sh -b `pwd`/.bin -./bin-directory/tfswitch +`pwd`/.bin/tfswitch ``` + If you have limited permission, try: ```sh @@ -19,13 +20,13 @@ If you have limited permission, try: echo "Installing tfswitch locally" wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh chmod 755 install.sh -./install.sh -b bin-directory +./install.sh -b `pwd`/.bin -CUSTOMBIN=`pwd`/bin #set custom bin path +CUSTOMBIN=`pwd`/.bin #set custom bin path mkdir $CUSTOMBIN #create custom bin path export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment -./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7 +`pwd`/.bin/tfswitch -b $CUSTOMBIN/terraform 0.11.7 terraform -v #testing version ``` @@ -58,13 +59,13 @@ jobs: wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh chmod 755 install.sh - ./install.sh -b bin-directory + ./install.sh -b $HOME/.bin + + CUSTOMBIN=$HOME/.bin #set custom bin path - CUSTOMBIN=`pwd`/bin #set custom bin path - mkdir $CUSTOMBIN #create custom bin path export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment - ./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7 + $CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7 terraform -v #testing version ``` \ No newline at end of file diff --git a/www/docs/Troubleshoot.md b/www/docs/Troubleshoot.md index 09b75378..1841ae38 100644 --- a/www/docs/Troubleshoot.md +++ b/www/docs/Troubleshoot.md @@ -21,14 +21,35 @@ Solution: You probably need to have privileges to install *tfswitch* at /usr/loc Try the following: ```sh -wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh -chmod 755 install.sh -./install.sh -b bin-directory +wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine: + +chmod 755 install.sh #Make installer executable + +./install.sh -b $HOME/.bin #Install tfswitch in a location you have permission: + +$HOME/.bin/tfswitch #test + +export PATH=$PATH:$HOME/.bin #Export your .bin into your path + +#You should probably add step 4 in your `.bash_profile` in your $HOME directory. + +#Next, try: +`tfswitch -b $HOME/.bin/terraform 0.11.7` + +#or simply + +`tfswitch -b $HOME/.bin/terraform` + -./bin-directory/tfswitch ``` -Or, use the custom directory option `-b`: +See the custom directory option `-b`: drawing +```sh +wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh +chmod 755 install.sh +./install.sh -b $HOME/.bin +$HOME/.bin/tfswitch +```