diff --git a/Makefile b/Makefile index 8049ede..c69ed39 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,12 @@ $(SERVER_PATH_LINUX): $(BUNDLE_PATH) sea-config.json rm -rf $(SERVER_PATH_LINUX) node --experimental-sea-config sea-config.json cp $(shell command -v node) $(SERVER_PATH_LINUX) + @ objdump -p $(SERVER_PATH_LINUX) | grep 'NEEDED' | grep -q 'libdl.so.2' || \ + { \ + printf "\n\n\x1b[1;31mYour $(shell command -v node) does not support Node SEA, which is needed to compile Vivify.\x1b[0m\n"; \ + printf "\x1b[1;31mPlease install Node.js through Node Version Manager (nvm) and try again.\x1b[0m\n"; \ + exit 1; \ + } chmod +w $(SERVER_PATH_LINUX) node_modules/.bin/postject $(SERVER_PATH_LINUX) NODE_SEA_BLOB $(BUILD_DIR)/sea-prep.blob \ --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 diff --git a/viv b/viv index 44c6bef..e17bf3c 100755 --- a/viv +++ b/viv @@ -1,5 +1,8 @@ #!/bin/sh +install_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) +vivify_server="$install_dir/vivify-server" + print_usage() { cat < "$output" 2> /dev/null & +nohup "$vivify_server" "$@" > "$output" 2> /dev/null & server_pid=$! monitor_server() { @@ -63,7 +86,7 @@ monitor_server() { monitor_server & # print stdout of vivify-server until STARTUP COMPLETE is found -tail -f "$output" | while read line; do +tail -f "$output" | while read -r line; do # server finished starting if echo "$line" | grep --quiet "STARTUP COMPLETE"; then pkill -P $$ tail