Skip to content

Commit 5583ef1

Browse files
committed
feat(stacks): add node
1 parent ecc2fa8 commit 5583ef1

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

stacks/node/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
generate-stack-path
9+
case "$OS_ARCH" in
10+
'amd64')
11+
downloadUrl="https://nodejs.org/dist/v${STACK_VERSION}/node-v${STACK_VERSION}-linux-x64.tar.xz";
12+
;;
13+
'arm64')
14+
downloadUrl="https://nodejs.org/dist/v${STACK_VERSION}/node-v${STACK_VERSION}-linux-arm64.tar.xz";
15+
;;
16+
*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;;
17+
esac;
18+
curl -fsSL -o node.tar.xz "${downloadUrl}"
19+
tar -xJf node.tar.xz
20+
cp -rf node-v${STACK_VERSION}-linux-*/* "${DATA_DIR}"
21+
rm -rf node-v${STACK_VERSION}-linux-* node.tar.xz
22+
}
23+
24+
# call build stack
25+
build-stack "${1}"

0 commit comments

Comments
 (0)