-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·24 lines (20 loc) · 886 Bytes
/
install.sh
File metadata and controls
executable file
·24 lines (20 loc) · 886 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
#!/bin/bash -eu
if [ -n "${CREW_DEST_PREFIX}" ]; then
INSTALL_PREFIX="${CREW_DEST_PREFIX}"
else
: "${INSTALL_PREFIX:=/usr/local}"
fi
mkdir -p ${INSTALL_PREFIX} ${INSTALL_PREFIX}/{lib,bin}
cp -r . ${INSTALL_PREFIX}/lib/crew-sudo
ln -sf ../lib/crew-sudo/crew-sudo ${INSTALL_PREFIX}/bin/crew-sudo
ln -sf ../lib/crew-sudo/crew-sudo ${INSTALL_PREFIX}/bin/sudo
if [ -n "${CREW_DEST_PREFIX}" ]; then
# installing under chromebrew
mkdir -p ${INSTALL_PREFIX}/etc/{env.d,bash.d}
ln -sf ../../lib/crew-sudo/autostart/crew-sudo.sh ${INSTALL_PREFIX}/etc/env.d/crew_sudo
ln -sf ../../lib/crew-sudo/autocomplete/crew-sudo.sh ${INSTALL_PREFIX}/etc/bash.d/crew_sudo
else
# installing without chromebrew, append the autostart script to bashrc
echo -e '\n'"source ${INSTALL_PREFIX}/lib/crew-sudo/autostart/crew-sudo.sh" >> ~/.bashrc
echo -e '\e[1;32m''crew-sudo installed!''\e[0m'
fi