fix patch script
This commit is contained in:
@@ -9,12 +9,17 @@ if [ ! -f "$PACKAGE_JSON" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q '"deb"' "$PACKAGE_JSON"; then
|
||||
echo "No deb target found in $PACKAGE_JSON, nothing to do."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Remove "deb" entry including trailing or leading comma
|
||||
sed -i '/"deb"/d' "$PACKAGE_JSON"
|
||||
|
||||
echo "Removed deb target from $PACKAGE_JSON."
|
||||
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.')
|
||||
"
|
||||
Reference in New Issue
Block a user