Skip to content

Commit 3dd3531

Browse files
committed
Update installer logic
1 parent 3477ee7 commit 3dd3531

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

install.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
#!/bin/bash -eu
2-
32
if [ -n "${CREW_DEST_PREFIX}" ]; then
43
INSTALL_PREFIX="${CREW_DEST_PREFIX}"
54
else
65
: "${INSTALL_PREFIX:=/usr/local}"
76
fi
87

9-
if [ ${EUID} != 0 ] && [ ! -w ${INSTALL_PREFIX} ]; then
10-
echo "Please run this script as root." 2>&1
11-
exit 1
12-
fi
8+
mkdir -p ${INSTALL_PREFIX} ${INSTALL_PREFIX}/{lib,bin}
139

14-
mkdir -p ${INSTALL_PREFIX}/lib
1510
cp -r . ${INSTALL_PREFIX}/lib/crew-sudo
1611

17-
mkdir -p ${INSTALL_PREFIX}/bin
1812
ln -sf ../lib/crew-sudo/crew-sudo ${INSTALL_PREFIX}/bin/crew-sudo
1913
ln -sf ../lib/crew-sudo/crew-sudo ${INSTALL_PREFIX}/bin/sudo
2014

@@ -26,4 +20,5 @@ if [ -d ${INSTALL_PREFIX}/etc/env.d ]; then
2620
else
2721
# installing without chromebrew, append the autostart script to bashrc
2822
echo "source ${INSTALL_PREFIX}/lib/crew-sudo/autostart/crew-sudo.sh" >> ~/.bashrc
23+
echo -e '\e[1;32m''crew-sudo installed!''\e[0m'
2924
fi

0 commit comments

Comments
 (0)