Created
June 4, 2020 16:09
-
-
Save snarlysodboxer/b145716f0c85c34787037b328a11a5f1 to your computer and use it in GitHub Desktop.
Swap Go Imports, for working with forked repos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" != "snarly" ] && [ "$1" != "fr" ]; then | |
echo "specify snarly or fr" | |
exit 1 | |
fi | |
if [ "$1" == "snarly" ]; then | |
find . -name '*.go' | xargs sed -i.bak 's/ForgeRock\/secret-agent/snarlysodboxer\/secret-agent/' | |
sed -i.bak 's/ForgeRock\/secret-agent/snarlysodboxer\/secret-agent/' go.mod | |
else | |
find . -name '*.go' | xargs sed -i.bak 's/snarlysodboxer\/secret-agent/ForgeRock\/secret-agent/' | |
sed -i.bak 's/snarlysodboxer\/secret-agent/ForgeRock\/secret-agent/' go.mod | |
fi | |
find . -name '*.go.bak' -delete | |
rm -rf go.mod.bak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment