Skip to content

Commit

Permalink
feat: add packaging script (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth authored Oct 19, 2023
1 parent c661b40 commit d2a36d1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

if [[ "$(uname -s)" != "Linux" ]]; then
echo "Error: This is not a Linux device."
exit 1
fi

if [ ! -f deps.zip ]; then
npm ci

zip -rq deps.zip node_modules
fi

if [ -f node.zip ]; then
exit 0
fi

rm -rf node-linux

mkdir node-linux
mkdir node-linux/include
mkdir node-linux/lib
mkdir node-linux/bin
mkdir node-linux/share

cp -r /usr/include/node node-linux/include/
cp -r /usr/local/lib/node_modules node-linux/lib/
cp -r /usr/local/bin/npm node-linux/bin/
cp -r /usr/local/bin/npx node-linux/bin/
cp -r /usr/bin/node node-linux/bin/
cp -r /usr/bin/corepack node-linux/bin/

zip -rq node.zip node-linux

0 comments on commit d2a36d1

Please sign in to comment.