From e6f1b309b592e9845ca8ece3b041f38044a7e0db Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Sat, 4 Oct 2025 11:46:47 +0200 Subject: [PATCH] Restore replaces --- replace.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 replace.sh diff --git a/replace.sh b/replace.sh new file mode 100644 index 0000000..c99f142 --- /dev/null +++ b/replace.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e + +# Replace template with actual repo data. +url=$(git remote get-url origin) + +url_nopro=${url#*//} +url_noatsign=${url_nopro#*@} + +gh_repo=${url_noatsign#"github.com:"} +gh_repo=${gh_repo#"github.com/"} +gh_repo=${gh_repo%".git"} + +project_name=$(basename $gh_repo) + +echo "## Replacing all bool64/go-template references by $project_name" +find ./.github -type f -print0 | xargs -0 perl -i -pe "s|bool64/go-template|$gh_repo|g" +find ./.github -type f -print0 | xargs -0 perl -i -pe "s|go-template|$project_name|g" +