File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ find_bin_path () {
2+ for dir in /usr/local/bin /usr/bin /bin; do
3+ if echo " $PATH " | grep -qE " (^|:)$dir (:|$)" ; then
4+ echo $dir
5+ return
6+ fi
7+ done
8+ }
9+
10+ set -e
11+
12+ echo " Installing kill-tree..."
13+
14+ bin_path=$( find_bin_path)
15+ if [ -z " $bin_path " ]; then
16+ echo " No bin path found in PATH"
17+ exit 1
18+ fi
19+
20+ temp_dir=$( mktemp -d)
21+ cd $temp_dir
22+
23+ curl -L -s https://api.github.com/repos/oneofthezombies/kill-tree/releases/latest | \
24+ grep " kill-tree-macos-x86_64" | \
25+ grep " browser_download_url" | \
26+ cut -d ' "' -f 4 | \
27+ xargs curl -L -s -o kill-tree && \
28+ chmod +x kill-tree && \
29+ mv kill-tree $bin_path /kill-tree && \
30+ rm -rf $temp_dir
31+
32+ echo " kill-tree install location: $bin_path /kill-tree"
33+
34+ echo " try printing version..."
35+ kill-tree --version
36+
37+ echo " kill-tree installed successfully."
38+ exit 0
39+
40+
You can’t perform that action at this time.
0 commit comments