-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c661b40
commit d2a36d1
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |