-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·33 lines (21 loc) · 885 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·33 lines (21 loc) · 885 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
32
33
#!/bin/bash
# install.sh — install gitkp as a global command (openmain style).
#
# Clones the repo to ~/.gitkeep-init, adds the line to ~/.bashrc,
# sources the script and leaves the gitkp command available
# from any directory, with tab autocompletion.
REPO_URL="https://github.com/aonisoft/gitkeep-init.git"
install_path=~/.gitkeep-init
echo "Downloading gitkeep-init in $install_path..."
[[ ! -d $install_path ]] || rm -fr $install_path
git clone "$REPO_URL" "$install_path/tmp" > /dev/null 2>&1
mv $install_path/tmp/* $install_path/
rm -fr $install_path/tmp
echo "It's done."
[[ -n $( grep ${install_path}/gitkeep-init.sh ~/.bashrc ) ]] || \
{
echo "Update bashrc..."
echo ". $install_path/gitkeep-init.sh" >> ~/.bashrc
}
source $install_path/gitkeep-init.sh
echo "The command to manage the .gitkeep structure is gitkp. Use tab the key to see subcommands."