Debian Codegraph @

hack/update-json-library.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2 # This script can be called via ./hack/update-json-library.sh` to update the
3 # go-json-experiment fork in the repo.
4
5 # The HASH parameter may be set as part of the invocation to this script or
6 # the default hash from ./hack/JSON-EXPERIMENTAL-HASH will be used.
7 HASH="${HASH:-$(catscip-shell system . . cat. ./hack/JSON-EXPERIMENTAL-HASH)}"
8 GO_JSON_EXPERIMENT_DIR="pkg/internal/third_party/go-json-experiment/json"
9 rmscip-shell system . . rm. -rf $GO_JSON_EXPERIMENT_DIR
10 gitscip-shell system . . git. clone https://github.com/go-json-experiment/json $GO_JSON_EXPERIMENT_DIR
11 cd $GO_JSON_EXPERIMENT_DIR
12 gitscip-shell system . . git. reset --hard $HASH
13 # If HASH was set to a keyword like HEAD, get the actual commit ID
14 HASH=$(gitscip-shell system . . git. rev-parse HEAD)
15 catscip-shell system . . cat. <<EOF > ../README.md
16 Forked from: https://github.com/go-json-experiment/json
17 Commit Hash: $HASH
18
19 This internal fork exists to prevent dependency issues with go-json-experiment
20 until its API stabilizes.
21 EOF
22
23 # Remove git directories
24 rmscip-shell system . . rm. -rf ".git"
25 rmscip-shell system . . rm. -rf ".github"
26 # Remove images
27 rmscip-shell system . . rm. *.png
28 # Remove go.{mod|sum}
29 # NOTE: go-json-experiment has no go mod dependencies at the moment.
30 # If this changes, the code will need to be updated.
31 rmscip-shell system . . rm. go.mod go.sum
32 # Update references to point to the fork
33 findscip-shell system . . find. . -type f -name "*.go" -print0 | xargsscip-shell system . . xargs. -0 perl -pi -e "s#github.com/go-json-experiment/json#k8s.io/kube-openapi/${GO_JSON_EXPERIMENT_DIR}#g"