-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.zsh
More file actions
executable file
·31 lines (24 loc) · 809 Bytes
/
install.zsh
File metadata and controls
executable file
·31 lines (24 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/zsh
install_dir=$HOME/bin/
if [[ -x ./config/install_dir.zsh ]]; then
source ./config/install_dir.zsh
else
echo "Copy scripts to directory:"
echo "$install_dir\n"
echo "Continue? (y/N) "
echo "# To prevent this prompt, see config/install_dir.example.zsh"
read sure
if [[ $sure != "y" ]]; then
echo "Aborded."
exit 1
fi
fi
mkdir -p $install_dir
cp -vi bin/gitdiffall.rb "$install_dir"gitdiffall.rb
cp -vi bin/gitdiffall.zsh "$install_dir"gitdiffall.zsh
if ! [[ -f "$install_dir"gitdiffall.zsh ]]; then
echo "Install failed, gitdiffall.zsh not exist."
exit 1
fi
local txt='[[ -z "$script_dir" ]] && local script_dir='$install_dir' # auto inserted by install.zsh\n '
echo -e $txt|cat - "$install_dir"gitdiffall.zsh > /tmp/out && mv /tmp/out "$install_dir"gitdiffall.zsh