diff --git a/.editorconfig b/.editorconfig index 5bd4d18..5a8de05 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,7 @@ # / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Creative Commons Zero v1.0 Universal # \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements # /___/ -# Version: v1.0.0 +# Version: v1.1.0 # ################################### @@ -25,3 +25,6 @@ trim_trailing_whitespace = false [*.{yml,yaml}] indent_size = 2 + +[*.bat] +end_of_line = crlf \ No newline at end of file diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index a366f5f..72a4a3d 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -5,7 +5,7 @@ # / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Creative Commons Zero v1.0 Universal # \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements # /___/ -# Version: v1.0.0 +# Version: v1.1.0 # ################################### --> diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6e05c5f..19e6b6d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,7 @@ # / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Creative Commons Zero v1.0 Universal # \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements # /___/ -# Version: v1.0.0 +# Version: v1.1.0 # ################################### version: 2 diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 5589ff4..f5255bd 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -4,7 +4,7 @@ # / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Creative Commons Zero v1.0 Universal # \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements # /___/ -# Version: v1.0.0 +# Version: v1.1.0 # ################################### name: Cleanup @@ -18,7 +18,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cleanup Sources run: ./scripts/cleanup-on-push-to-main.sh - name: Create Pull Request if necessary diff --git a/.gt/remotes/tegonal-gh-commons/lib/src/gt/pull-hook-functions.sh b/.gt/remotes/tegonal-gh-commons/lib/src/gt/pull-hook-functions.sh index 7788ff1..0cb9800 100644 --- a/.gt/remotes/tegonal-gh-commons/lib/src/gt/pull-hook-functions.sh +++ b/.gt/remotes/tegonal-gh-commons/lib/src/gt/pull-hook-functions.sh @@ -5,7 +5,7 @@ # / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Creative Commons Zero v1.0 Universal # \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements # /___/ -# Version: v1.0.0 +# Version: v1.1.0 # ####### Description ############# # @@ -18,8 +18,9 @@ # shopt -s inherit_errexit # MY_PROJECT_LATEST_VERSION="v1.0.0" # -# # Assumes tegonal's github-commons was fetched with gt - adjust location accordingly -# dir_of_github_commons="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)/../lib/tegonal-gh-common/src" +# # Assumes tegonal's github-commons was fetched with gt and put into repoRoot/.gt/remotes/tegonal-gh-commons/lib +# # - adjust remote name or location accordingly +# dir_of_github_commons="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)/lib/src" # # if ! [[ -v dir_of_tegonal_scripts ]]; then # dir_of_tegonal_scripts="$dir_of_github_commons/../tegonal-scripts/src" @@ -31,6 +32,7 @@ # declare _tag=$1 source=$2 _target=$3 # shift 3 || die "could not shift by 3" # +# replacePlaceholdersCodeOfConduct "$source" "code-of-conduct@my-company.com" # replacePlaceholdersContributorsAgreement "$source" "my-project-name" "MyCompanyName, Country" # replacePlaceholdersPullRequestTemplate "$source" "https://github.com/tegonal/my-project-name" "$MY_PROJECT_LATEST_VERSION" # @@ -64,9 +66,9 @@ function replacePlaceholdersContributorsAgreement() { local -r projectName=$2 local -r owner=$3 shift 3 || die "could not shift by 3" - perl -0777 -i \ - -pe "s//$projectName/g;" \ - -pe "s//$owner/g;" \ + PROJECT_NAME="$projectName" OWNER="$owner" perl -0777 -i \ + -pe 's//$ENV{PROJECT_NAME}/g;' \ + -pe 's//$ENV{OWNER}/g;' \ "$file" } @@ -97,12 +99,40 @@ function replacePlaceholdersPullRequestTemplate() { local -r url=$2 local -r tag=$3 shift 3 || die "could not shift by 3" - perl -0777 -i \ - -pe "s##$url#g;" \ - -pe "s##$tag#g;" \ + TAG="$tag" GITHUB_URL="$url" perl -0777 -i \ + -pe 's##$ENV{GITHUB_URL}#g;' \ + -pe 's##$ENV{TAG}#g;' \ "$file" } +function replacePlaceholdersCodeOfConduct(){ + if ! (($# == 2)); then + logError "you need to pass two arguments to replacePlaceholdersCodeOfConductTemplate" + echo "1: file represents the 'CODE_OF_CONDUCT.md'" + echo "2: owner_email email address which should be contacted in case of a violation" + printStackTrace + exit 9 + fi + local -r file=$1 + local -r ownerEmail=$2 + shift 2 || die "could not shift by 2" + EMAIL="$ownerEmail" perl -0777 -i \ + -pe 's//$ENV{EMAIL}/g;' \ + "$file" +} + +function replacePlaceholdersCodeOfConduct_Tegonal(){ + if ! (($# == 1)); then + logError "you need to pass one arguments to replacePlaceholdersCodeOfConductTemplate" + echo "1: file represents the 'CODE_OF_CONDUCT.md'" + printStackTrace + exit 9 + fi + local -r file=$1 + shift 1 || die "could not shift by 1" + replacePlaceholdersCodeOfConduct "$file" "info@tegonal.com" +} + function replaceTagInPullRequestTemplate() { if ! (($# == 3)); then logError "you need to pass three arguments to replaceTagInPullRequestTemplate" diff --git a/.gt/remotes/tegonal-gh-commons/pull-hook.sh b/.gt/remotes/tegonal-gh-commons/pull-hook.sh index 172c54d..67e65f3 100755 --- a/.gt/remotes/tegonal-gh-commons/pull-hook.sh +++ b/.gt/remotes/tegonal-gh-commons/pull-hook.sh @@ -34,6 +34,8 @@ function gt_pullHook_tegonal_gh_commons_before() { if [[ $source =~ .*/\.github/Contributor[[:space:]]Agreement\.txt ]]; then replacePlaceholdersContributorsAgreement_Tegonal "$source" "minimalist" + elif [[ $source =~ .*/\.github/CODE_OF_CONDUCT.md ]]; then + replacePlaceholdersCodeOfConduct_Tegonal "$source" elif [[ $source =~ .*/\.github/PULL_REQUEST_TEMPLATE.md ]]; then # same as in additional-release-files-preparations.sh local -r githubUrl="https://github.com/tegonal/minimalist" diff --git a/.gt/remotes/tegonal-gh-commons/pulled.tsv b/.gt/remotes/tegonal-gh-commons/pulled.tsv index 5688d88..b0b09fc 100644 --- a/.gt/remotes/tegonal-gh-commons/pulled.tsv +++ b/.gt/remotes/tegonal-gh-commons/pulled.tsv @@ -1,9 +1,10 @@ +#@ Version: 1.0.0 tag file relativeTarget sha512 -v1.0.0 src/.github/CODE_OF_CONDUCT.md ../.github/CODE_OF_CONDUCT.md 2a40d61e7f7527f37b66623197393ad8aa1ba7156900595dc9dc32e628c7fdeaa57795238fa89a3cc98cb921149dcc03f3938c917ddf8ce03af0aa9cd4fef829 -v1.0.0 src/.github/PULL_REQUEST_TEMPLATE.md ../.github/PULL_REQUEST_TEMPLATE.md 9112d1ea1f72ea250cdfe686fc152e63f2e0cdcea9c46935289471d7a3f54c35af8a3f283570f5d863e936c7782939c7b1548cb7d4ccda712bbf9314926f58cb -v1.0.0 src/gt/pull-hook-functions.sh remotes/tegonal-gh-commons/lib/src/gt/pull-hook-functions.sh e837edf3d980add930f81062298ce052f053458789a7b09f16c7874bab20ce8a14ac6ee24c4f8dcc923a80e0662a46c42de83fcc755807f3f1a7fa65ff386fc5 -v1.0.0 src/.github/Contributor Agreement.txt ../.github/Contributor Agreement.txt 8ae9a779436b7e3c1bb1ebc3317b5d53fca85acfd53ecdb9c22c7bc3ed063f01f8dad2e8cfc5dfea0bde47d61c09e6323f4b1510c96a2bc8ffacf0b572b0e6ab -v1.0.0 src/dotfiles/.editorconfig ../.editorconfig 0395c3361c283ca83081823b5e7eaa3b6309e40b0fa66a9905e69a7aa7ca6cb94a313ec95f9292bad144b225af8de4578e6b59a372f0637314fa41cb9e76f7b5 -v1.0.0 src/.github/workflows/cleanup.yml ../.github/workflows/cleanup.yml 2280253fa8846af3d1af8d4553c90bcae5d5dd6bb68704efa5e7a6bb6c48e42a3d25e55f0320177f97cd8be7b65ba16f1539e8c20218751a11ec48ebb9567f22 -v1.0.0 src/.github/dependabot.yml ../.github/dependabot.yml 056cb647b4978b6dc50dcb7f9378f26c48d35a48e511cd9237bbf64930ab1e70dcc3db9bb4827964c55ee1a65d8d89a8bbd91d3255b4754adffc79b0bd895576 -v1.0.0 src/dotfiles/.shellcheckrc ../.shellcheckrc 7f0ffaa1380a62c015fd01bdc94926ca61bfd824b21828bb597b944fbdc866f684d1e2e167aeb5d49df7f157109ac3fdd36d772e5339695fde1e694fcef011b1 +v1.1.0 src/.github/CODE_OF_CONDUCT.md ../.github/CODE_OF_CONDUCT.md e7b2fb4597b0649fd891899a5807538ae122f85dfc128a7e21a6431ba493c62beae4ea324b666559d9e2fafbb76ae80f378fde24d0d454ffd15936563bbc8433 +v1.1.0 src/.github/PULL_REQUEST_TEMPLATE.md ../.github/PULL_REQUEST_TEMPLATE.md 9112d1ea1f72ea250cdfe686fc152e63f2e0cdcea9c46935289471d7a3f54c35af8a3f283570f5d863e936c7782939c7b1548cb7d4ccda712bbf9314926f58cb +v1.1.0 src/gt/pull-hook-functions.sh remotes/tegonal-gh-commons/lib/src/gt/pull-hook-functions.sh 14909cfe7f2c0af16f49b20289dedf680e4fd776c40c8b2f7e3c5e513f441f9dc675c8271a6c43d62a1e1a1a730e91c1a96e4363feb2b0d17f1a01f60363c16c +v1.1.0 src/.github/Contributor Agreement.txt ../.github/Contributor Agreement.txt 8ae9a779436b7e3c1bb1ebc3317b5d53fca85acfd53ecdb9c22c7bc3ed063f01f8dad2e8cfc5dfea0bde47d61c09e6323f4b1510c96a2bc8ffacf0b572b0e6ab +v1.1.0 src/dotfiles/.editorconfig ../.editorconfig f015c82e933f0cd954bed51451d7640c6f289d9d1a60f461746648bf7b88a7e93ba36b678dfa2fb4290b9a4ad73bea698531d3ff77c04b23982e6c4be477e876 +v1.1.0 src/.github/workflows/cleanup.yml ../.github/workflows/cleanup.yml efa06802a7b2ba6f676ee77056d2d7c219da2652e92fa5bdaea045143a927de26c12fe547c43b5e8ad4f78af2d051c680c76f4e6cb1b726cac519e476aace8f6 +v1.1.0 src/.github/dependabot.yml ../.github/dependabot.yml 07d190f91d13e337d5ebaf5c9ee5e749f4469e275628dc0c1ef925f169a5b9bf39c5ff555df9d2a9e66e13d9a39351c442adec7cd2b0feffee7e58d66886cca7 +v1.1.0 src/dotfiles/.shellcheckrc ../.shellcheckrc 3bdce07d2407f4632eeb3e4ac7c60e6b840ca95084a9fd3ccdcc983b585887a8ea8c15e36327efacea03cf9f6b5704cb64ac71607725171dd899d9df04dd438c diff --git a/.shellcheckrc b/.shellcheckrc index e0cb0ee..763b8ba 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -4,7 +4,7 @@ # / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Creative Commons Zero v1.0 Universal # \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements # /___/ -# Version: v1.0.0 +# Version: v1.1.0 # ###################################