diff --git a/patch-potacat.sh b/patch-potacat.sh index 5a12ae0..e2c68b5 100755 --- a/patch-potacat.sh +++ b/patch-potacat.sh @@ -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." \ No newline at end of file +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.') +" \ No newline at end of file