Skip to content

Commit 11baeec

Browse files
committed
removing nodejs executable for mac and linux
1 parent e9424d3 commit 11baeec

File tree

7 files changed

+61
-23
lines changed

7 files changed

+61
-23
lines changed

host.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let files = [];
2020
const sprocess = [];
2121

2222
const config = {
23-
version: '0.9.7'
23+
version: '0.9.8'
2424
};
2525
// closing node when parent process is killed
2626
process.stdin.resume();

install.sh

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,71 @@
11
#!/usr/bin/env bash
22

3+
# Define Node.js version and base URL
4+
NODE_VERSION="v18.20.5"
5+
NODE_BASE_URL="https://nodejs.org/download/release/${NODE_VERSION}"
6+
NODE_INSTALL_DIR="./node"
7+
38
cd "$(dirname "$0")/app"
49

5-
which node 2>/dev/null
6-
isNode=$?
7-
echo NodeJS status = $isNode
10+
# Function to determine the appropriate Node.js binary
11+
get_node_binary_url() {
12+
OS_TYPE=$(uname | tr '[:upper:]' '[:lower:]')
13+
MACHINE_TYPE=$(uname -m)
14+
15+
case "${OS_TYPE}" in
16+
linux)
17+
case "${MACHINE_TYPE}" in
18+
x86_64) echo "${NODE_BASE_URL}/node-${NODE_VERSION}-linux-x64.tar.gz" ;;
19+
*64)
20+
# If the machine type ends with '64' and is not x86_64, assume it's ARM64
21+
echo "${NODE_BASE_URL}/node-${NODE_VERSION}-linux-arm64.tar.gz" ;;
22+
armv7l) echo "${NODE_BASE_URL}/node-${NODE_VERSION}-linux-armv7l.tar.gz" ;;
23+
ppc64le) echo "${NODE_BASE_URL}/node-${NODE_VERSION}-linux-ppc64le.tar.gz" ;;
24+
s390x) echo "${NODE_BASE_URL}/node-${NODE_VERSION}-linux-s390x.tar.gz" ;;
25+
*) echo "Unsupported architecture: ${MACHINE_TYPE}" >&2; exit 1 ;;
26+
esac
27+
;;
28+
darwin)
29+
case "${MACHINE_TYPE}" in
30+
x86_64) echo "${NODE_BASE_URL}/node-${NODE_VERSION}-darwin-x64.tar.gz" ;;
31+
arm64) echo "${NODE_BASE_URL}/node-${NODE_VERSION}-darwin-arm64.tar.gz" ;;
32+
*) echo "Unsupported architecture: ${MACHINE_TYPE}" >&2; exit 1 ;;
33+
esac
34+
;;
35+
*)
36+
echo "Unsupported OS: ${OS_TYPE}" >&2
37+
exit 1
38+
;;
39+
esac
40+
}
41+
42+
# Check if Node.js is globally installed
43+
which node >/dev/null 2>&1
44+
IS_NODE_GLOBAL=$?
845

9-
if [ $isNode -eq 0 ]; then
46+
if [ $IS_NODE_GLOBAL -eq 0 ]; then
1047
node -e "process.exit(Number(process.version.substr(1).split('.')[0]) > 5 ? 0 : 1)"
11-
isNode=$?
48+
IS_NODE_GLOBAL=$?
1249
fi
13-
if [ $isNode -eq 0 ]; then
50+
51+
if [ $IS_NODE_GLOBAL -eq 0 ]; then
1452
echo "Installer is using your system NodeJS."
1553
echo
16-
node install.js `which node` $1
54+
node install.js "$(which node)" "$1"
1755
else
18-
MACHINE_TYPE=`uname -m`
19-
echo "Installer is using the embedded NodeJS"
20-
echo
21-
if [[ $OSTYPE == 'darwin'* ]]; then
22-
if [[ $MACHINE_TYPE == 'arm64' ]]; then
23-
../node/arm64/node install.js --add_node $1
24-
else
25-
../node/x64/node install.js --add_node $1
26-
fi
27-
elif [ ${MACHINE_TYPE} == 'x86_64' ]; then
28-
../node/x64/node install.js --add_node $1
29-
else
30-
../node/x86/node install.js --add_node $1
31-
fi
56+
echo "Node.js not found or version is less than 6. Downloading Node.js..."
57+
mkdir -p "${NODE_INSTALL_DIR}"
58+
59+
NODE_URL=$(get_node_binary_url)
60+
NODE_ARCHIVE="${NODE_INSTALL_DIR}/node.tar.gz"
61+
62+
echo "Downloading ${NODE_URL}..."
63+
curl -o "${NODE_ARCHIVE}" "${NODE_URL}"
64+
65+
echo "Extracting Node.js..."
66+
tar -xzf "${NODE_ARCHIVE}" -C "${NODE_INSTALL_DIR}" --strip-components=1
67+
rm "${NODE_ARCHIVE}"
68+
69+
echo "Running installer with embedded Node.js..."
70+
"${NODE_INSTALL_DIR}/bin/node" install.js --add_node "$1"
3271
fi

linux/node/x64/node

-39.2 MB
Binary file not shown.

linux/node/x86/ReadMe

Lines changed: 0 additions & 1 deletion
This file was deleted.

linux/node/x86/node

-36.6 MB
Binary file not shown.

mac/node/arm64/node

-84 MB
Binary file not shown.

mac/node/x64/node

-39.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)