Skip to content
Snippets Groups Projects
Commit b745bc1a authored by Wortman, Elliot (UG - Comp Sci & Elec Eng)'s avatar Wortman, Elliot (UG - Comp Sci & Elec Eng)
Browse files

Bash script to create a demo zip

parent cbd23c3d
No related branches found
No related tags found
1 merge request!5Replace Vue3 template site with NanoPatch UI & API
...@@ -28,4 +28,5 @@ coverage ...@@ -28,4 +28,5 @@ coverage
*.sw? *.sw?
__pycache__/ __pycache__/
env/ env/
\ No newline at end of file archive.zip
#!/bin/bash -ex
# Check if npm is installed
if ! hash npm 2>/dev/null; then
echo "Error: npm is not installed."
exit 1
fi
# Check if zip is installed
if ! hash zip 2>/dev/null; then
echo "Error: zip is not installed."
exit 1
fi
# Remove 'dist' and 'node_modules' directories if they exist
echo "Cleaning up old 'dist' and 'node_modules' directories..."
rm -rf dist node_modules
# Run npm install
echo "Running npm install..."
npm ci
# Run npm build
echo "Running npm run build..."
npm run build
# Check if the build was successful and 'dist' directory exists
if [ ! -d "dist" ]; then
echo "Error: 'dist' directory not found. Build may have failed."
exit 1
fi
# Check if 'requirements.txt' exists
if [ ! -f "requirements.txt" ]; then
echo "Error: 'requirements.txt' file not found."
exit 1
fi
# Check if 'app.py' exists
if [ ! -f "app.py" ]; then
echo "Error: 'app.py' file not found."
exit 1
fi
# Create a zip file
zip -r archive.zip requirements.txt app.py dist
echo "Archive 'archive.zip' created successfully."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment