mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: Add scripts for cleaning and installing node modules
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
"prerun": "bash configure.sh",
|
||||
"typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js",
|
||||
"uninstall": "bash uninstall.sh",
|
||||
"clean-modules": "bash remove-node-modules.sh",
|
||||
"install-modules": "bash install-node-modules.sh",
|
||||
"lint": "export NODE_OPTIONS='--max-old-space-size=32768' && npx eslint . --cache",
|
||||
"fix-lint": "export NODE_OPTIONS='--max-old-space-size=32768' && npx eslint . --fix --cache --debug",
|
||||
"fix": "npm run fix-lint",
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
echo "Removing node_modules directories..."
|
||||
|
||||
for d in */ ; do
|
||||
cd $d || echo "Cannot cd into $d"
|
||||
rm -rf node_modules || echo "node_modules directory not found $d"
|
||||
cd .. || echo "Cannot cd out"
|
||||
done
|
||||
if [ -d "$d" ]; then
|
||||
cd "$d" || { echo "Cannot cd into $d"; continue; }
|
||||
|
||||
if [ -d "node_modules" ]; then
|
||||
echo "Removing node_modules in $d"
|
||||
rm -rf node_modules || echo "Failed to remove node_modules in $d"
|
||||
else
|
||||
echo "No node_modules found in $d"
|
||||
fi
|
||||
|
||||
cd .. || echo "Cannot cd out of $d"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Finished removing node_modules directories."
|
||||
Reference in New Issue
Block a user