27 lines
747 B
Bash
27 lines
747 B
Bash
#!/bin/bash
|
|
VERSION=1.5
|
|
|
|
# Check if any arguments are passed
|
|
if [ $# -eq 0 ]; then
|
|
# Default targets if no arguments are given
|
|
targets=("chrome" "firefox")
|
|
else
|
|
# Use the provided arguments as targets
|
|
targets=("$@")
|
|
fi
|
|
|
|
# Iterate over each target
|
|
for target in "${targets[@]}"; do
|
|
# Remove old file if exists
|
|
rm "output/sleepytabs_${VERSION}_${target}.zip" 2>/dev/null
|
|
|
|
# Create a zip file excluding bin/* and ./manifest*.json
|
|
zip -r "output/sleepytabs_${VERSION}_${target}.zip" . -x ".git*" "bin*" "output*" "./manifest*.json"
|
|
|
|
# Copy the target-specific manifest file into the zip
|
|
cp "manifest-${target}.json" "manifest.json"
|
|
zip -u "output/sleepytabs_${VERSION}_${target}.zip" "manifest.json"
|
|
rm "manifest.json"
|
|
|
|
done
|