mirror of
https://github.com/zardus/ctf-tools
synced 2024-12-04 18:29:26 +00:00
Let zsteg install script add rubygems PATH to (bash|zsh)rc, config.fish
This commit is contained in:
parent
d62247af0e
commit
f4b8abf963
1 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,27 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
gem install --user-install zsteg
|
||||
|
||||
GEM_BIN_PATH=$(gem environment | grep "USER INSTALL" | awk -F ': ' '{ print $2 }')/bin
|
||||
|
||||
MAGIC="# ctf-tools: gem install"
|
||||
for f in ~/.bashrc ~/.zshrc; do
|
||||
if [[ -e "$f" ]]; then
|
||||
if ! grep "$MAGIC" "$f" >/dev/null 2>&1; then
|
||||
cat >> "$f" << EOF
|
||||
$MAGIC
|
||||
export PATH=\$PATH:$GEM_BIN_PATH
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
f=~/.config/fish/config.fish
|
||||
if [[ -e "$f" ]]; then
|
||||
if ! grep "$MAGIC" "$f" >/dev/null 2>&1; then
|
||||
cat >> "$f" << EOF
|
||||
$MAGIC
|
||||
set -x PATH \$PATH $GEM_BIN_PATH
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue