Files
eden/tools/cpm/package/util/replace.sh
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
341 B
Bash
Raw Normal View History

2025-12-31 17:16:46 +01:00
#!/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"