25 lines
643 B
Bash
Executable File
25 lines
643 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Purpose : Remove deb target from electron-builder package.json
|
|
|
|
PACKAGE_JSON="${1:-package.json}"
|
|
|
|
if [ ! -f "$PACKAGE_JSON" ]; then
|
|
echo "Error: $PACKAGE_JSON not found."
|
|
exit 1
|
|
fi
|
|
|
|
python3 -c "
|
|
import json, sys
|
|
with open('$PACKAGE_JSON', 'r') as f:
|
|
data = json.load(f)
|
|
targets = data.get('build', {}).get('linux', {}).get('target', [])
|
|
if 'deb' in targets:
|
|
targets.remove('deb')
|
|
data['build']['linux']['target'] = targets
|
|
with open('$PACKAGE_JSON', 'w') as f:
|
|
json.dump(data, f, indent=2)
|
|
print('Removed deb target from $PACKAGE_JSON.')
|
|
else:
|
|
print('No deb target found, nothing to do.')
|
|
" |