-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
22 lines (16 loc) · 738 Bytes
/
install.sh
File metadata and controls
22 lines (16 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
# Author: Darren Klein
# Github repo: https://github.com/darrenklein/trash
# Version: 1.0.3
# Adapted with thanks, from https://github.com/alexanderepstein/Bash-Snippets/blob/master/install.sh
read -p "Install trash? [Y/n]: " answer
answer=${answer:-Y}
if [[ "$answer" == [Yy] ]]; then
echo "Installing trash..."
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latest_tag -q
chmod a+x trash
cp trash /usr/local/bin > /dev/null 2>&1 || { echo "Failure!"; echo "Error copying file, try running install script as sudo."; exit 1; }
git checkout master -q
echo "Successfully installed trash - happy trashing!"
fi