diff options
Diffstat (limited to 'tools/cpm/package/util/replace.sh')
| -rwxr-xr-x | tools/cpm/package/util/replace.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/cpm/package/util/replace.sh b/tools/cpm/package/util/replace.sh new file mode 100755 index 0000000000..4ec65384da --- /dev/null +++ b/tools/cpm/package/util/replace.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2025 crueter +# SPDX-License-Identifier: LGPL-3.0-or-later + +# Replace a specified package with a modified json. + +FILE=$(echo "$CPMFILES" | xargs grep -l "\"$1\"") + +jq --indent 4 --argjson repl "$2" ".\"$1\" *= \$repl" "$FILE" >"$FILE".new +mv "$FILE".new "$FILE" + +echo "-- * -- Updated $FILE" |
