File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22set -euo pipefail
33
44TOROT_VERSION=" 4.0.0"
5- BINARY_URL=" https://github.com/torot/torot/releases/download/v${TOROT_VERSION} /torot-$( uname -s) -$( uname -m) .tar.gz"
6- INSTALL_DIR=" ${INSTALL_DIR:-/ usr/ local/ bin} "
5+ BINARY_URL=" https://github.com/Chintanpatel24/torot/releases/download/v${TOROT_VERSION} /torot-$( uname -s) -$( uname -m) .tar.gz"
6+
7+ if [ " $( id -u) " -ne 0 ] && [ -w " /usr/local/bin" ]; then
8+ INSTALL_DIR=" ${INSTALL_DIR:-/ usr/ local/ bin} "
9+ else
10+ INSTALL_DIR=" ${INSTALL_DIR:- $HOME / .local/ bin} "
11+ fi
12+
13+ mkdir -p " $INSTALL_DIR "
714
815info () { printf " \033[32m->\033[0m %s\n" " $* " ; }
916warn () { printf " \033[33m!\033[0m %s\n" " $* " ; }
@@ -13,6 +20,7 @@ if [ -f "target/release/torot" ]; then
1320 info " Found local release build, installing..."
1421 install -m 755 target/release/torot " ${INSTALL_DIR} /torot"
1522 info " Installed torot to ${INSTALL_DIR} /torot"
23+ info " Make sure ${INSTALL_DIR} is in your PATH"
1624 exit 0
1725fi
1826
@@ -21,6 +29,7 @@ if command -v cargo &>/dev/null; then
2129 cargo build --release
2230 install -m 755 target/release/torot " ${INSTALL_DIR} /torot"
2331 info " Installed torot to ${INSTALL_DIR} /torot"
32+ info " Make sure ${INSTALL_DIR} is in your PATH"
2433 exit 0
2534fi
2635
You can’t perform that action at this time.
0 commit comments