Skip to content

Commit 80c2993

Browse files
committed
append to zshrc not overwrite
1 parent 0e054b6 commit 80c2993

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

get-gram.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
22

3-
43
## Get GOOS and GOARCH
54
case $(uname -m) in
65
i386) goarch="386" ;;
@@ -40,17 +39,15 @@ fi
4039

4140

4241
# Download and extract binary
43-
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")
44-
wget -q $tar_gz_url -O gram.tar.gz > /dev/null
45-
tar -xf gram.tar.gz
46-
rm gram.tar.gz
42+
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")
43+
wget -q $binary_url -O gram > /dev/null
4744

4845
# Set gram command
4946
chmod +x gram
5047

5148
# Set gram binary to path and alias
5249
alias gram="$(pwd)/gram"
53-
echo "export PATH=$PATH:$(pwd)/gram" > ~/.bashrc
54-
echo "export PATH=$PATH:$(pwd)/gram" > ~/.zshrc
50+
echo "export PATH=\$PATH:$(pwd)/gram" >> ~/.bashrc
51+
echo "export PATH=\$PATH:$(pwd)/gram" >> ~/.zshrc
5552

5653

0 commit comments

Comments
 (0)