Skip to content

Commit

Permalink
append to zshrc not overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeadie committed Oct 2, 2022
1 parent 0e054b6 commit 80c2993
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions get-gram.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash


## Get GOOS and GOARCH
case $(uname -m) in
i386) goarch="386" ;;
Expand Down Expand Up @@ -40,17 +39,15 @@ fi


# Download and extract binary
tar_gz_url=$(curl -s https://api.github.com/repos/jeadie/gram/releases/latest | jq -r ".assets[] | select(.name | test(\"gram-${goos}-${goarch}.tar.gz\")) | .browser_download_url" | grep -v "md5")
wget -q $tar_gz_url -O gram.tar.gz > /dev/null
tar -xf gram.tar.gz
rm gram.tar.gz
binary_url=$(curl -s https://api.github.com/repos/jeadie/gram/releases/latest | jq -r ".assets[] | select(.name | test(\"gram-${goos}-${goarch}\")) | .browser_download_url" | grep -v "md5")
wget -q $binary_url -O gram > /dev/null

# Set gram command
chmod +x gram

# Set gram binary to path and alias
alias gram="$(pwd)/gram"
echo "export PATH=$PATH:$(pwd)/gram" > ~/.bashrc
echo "export PATH=$PATH:$(pwd)/gram" > ~/.zshrc
echo "export PATH=\$PATH:$(pwd)/gram" >> ~/.bashrc
echo "export PATH=\$PATH:$(pwd)/gram" >> ~/.zshrc


0 comments on commit 80c2993

Please sign in to comment.