Skip to content

Commit c3f5e90

Browse files
committed
Fixed the function error when run via Curl
1 parent de56571 commit c3f5e90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
# This is an install script for notes
44

5+
# Yay, Echo self documents! :D
6+
echo "Checking for root..."
7+
[ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@"
8+
9+
# This has to be defined after root elevation or script will fail.
510
function assertInstalled() {
611
for var in "$@"; do
712
if ! which $var &> /dev/null; then
@@ -11,10 +16,6 @@ function assertInstalled() {
1116
done
1217
}
1318

14-
# Yay, Echo self documents! :D
15-
echo "Checking for root..."
16-
[ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@"
17-
1819
# Make sure we have everything actually installed that we need to install this.
1920
echo "Checking for Dependencies..."
2021
assertInstalled bash curl tar mktemp install make

0 commit comments

Comments
 (0)