From 7f248c53db7604abc95fc5462e9d0180ca9583e9 Mon Sep 17 00:00:00 2001 From: Jannis Baum Date: Fri, 30 Aug 2024 10:21:34 -0500 Subject: [PATCH 1/6] change!(#175): drop support for non-posix shells --- viv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/viv b/viv index 44c6bef..ae77af2 100755 --- a/viv +++ b/viv @@ -18,7 +18,7 @@ EOF print_bug_report() { cat < Date: Fri, 30 Aug 2024 10:23:49 -0500 Subject: [PATCH 2/6] fix(#175): quoting --- viv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viv b/viv index ae77af2..87d6555 100755 --- a/viv +++ b/viv @@ -40,7 +40,7 @@ cleanup() { } trap cleanup EXIT -nohup vivify-server $@ > "$output" 2> /dev/null & +nohup vivify-server "$@" > "$output" 2> /dev/null & server_pid=$! monitor_server() { From 3caf30bb1e0fd5ab9cc907e42f1359e82cb2894c Mon Sep 17 00:00:00 2001 From: Jannis Baum Date: Fri, 30 Aug 2024 10:24:22 -0500 Subject: [PATCH 3/6] fix(#175): preserve backslashes in startup output --- viv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viv b/viv index 87d6555..f760593 100755 --- a/viv +++ b/viv @@ -63,7 +63,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 From 73bd0a31a3a5002853aefce6828ebd1bb897eff6 Mon Sep 17 00:00:00 2001 From: Jannis Baum Date: Fri, 30 Aug 2024 10:29:34 -0500 Subject: [PATCH 4/6] feat(#175): get vivify-server from same directory as viv --- viv | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/viv b/viv index f760593..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() { From 282fc683e0c4ab58b76e8a9b9580924acb512a69 Mon Sep 17 00:00:00 2001 From: Jannis Baum Date: Tue, 3 Sep 2024 11:39:30 -0500 Subject: [PATCH 5/6] feat(#175): catch bad node --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 8049ede..c4adc79 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,8 @@ $(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' || \ + { echo "Your $(shell command -v node) does not support Node SEA. Please install Node through nvm and try again."; 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 From 1121ff2bf6833c1c1bc4c77456f58c6015adbc44 Mon Sep 17 00:00:00 2001 From: Jannis Baum Date: Tue, 3 Sep 2024 11:55:55 -0500 Subject: [PATCH 6/6] feat(#175): improve visibility of message --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c4adc79..c69ed39 100644 --- a/Makefile +++ b/Makefile @@ -72,8 +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' || \ - { echo "Your $(shell command -v node) does not support Node SEA. Please install Node through nvm and try again."; exit 1; } + @ 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