-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·33 lines (25 loc) · 795 Bytes
/
install
File metadata and controls
executable file
·33 lines (25 loc) · 795 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
#!/usr/bin/bash
usage="Usage: $(basename "$0") [-h | --help]
The executable located at ./src/tmux-session will be installed by copying
it to /usr/local/bin/tmux-session.
Options:
-h, --help Show this help text."
directory=/usr/local/bin
this_dir=$(dirname $(realpath ${BASH_SOURCE:-$0}))
if [[ $1 == "-h" || $1 == "--help" ]]; then
echo "$usage"
exit 0
fi
if [[ $# -gt 1 ]]; then
echo "$usage"
exit 1
fi
if [[ ! -d $directory ]]; then
echo "Directory $directory does not exist. Install tmux-session manually by
placing the executable located at ./src/tmux-session in a directory that is
in your PATH."
exit 1
fi
echo "Installing tmux-session at $directory/tmux-session"
cp -r "$this_dir/src/tmux-session" "$directory/tmux-session"
echo "Installation done."