fix patch script
This commit is contained in:
@@ -9,12 +9,17 @@ if [ ! -f "$PACKAGE_JSON" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q '"deb"' "$PACKAGE_JSON"; then
|
python3 -c "
|
||||||
echo "No deb target found in $PACKAGE_JSON, nothing to do."
|
import json, sys
|
||||||
exit 0
|
with open('$PACKAGE_JSON', 'r') as f:
|
||||||
fi
|
data = json.load(f)
|
||||||
|
targets = data.get('build', {}).get('linux', {}).get('target', [])
|
||||||
# Remove "deb" entry including trailing or leading comma
|
if 'deb' in targets:
|
||||||
sed -i '/"deb"/d' "$PACKAGE_JSON"
|
targets.remove('deb')
|
||||||
|
data['build']['linux']['target'] = targets
|
||||||
echo "Removed deb target from $PACKAGE_JSON."
|
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