diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-09-30 16:30:20 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-09-30 16:30:20 +0200 |
commit | f7797042c34b45f8cf34c4dc17ef37b4a16d2d6a (patch) | |
tree | 173e4b989acfdc4ed66f575df6e524e0c1a2e71a | |
parent | fix(templates/latex/letter): Improve standard latex settings (diff) | |
download | flake-templates-f7797042c34b45f8cf34c4dc17ef37b4a16d2d6a.tar.gz flake-templates-f7797042c34b45f8cf34c4dc17ef37b4a16d2d6a.zip |
fix(common/init): Be smarter, when suggesting an owner name
-rw-r--r-- | common/init | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/init b/common/init index 77071f9..7fdc1e6 100644 --- a/common/init +++ b/common/init @@ -83,7 +83,15 @@ prompt AUTHOR_EMAIL "The email of the author (or authors)" "$(git config --get u # cog change-log variables prompt REMOTE "The remote, this project will be pushed to" "git.vhack.eu" prompt REPOSITORY "The path of the repository on the remote" "$APPLICATION_NAME" -prompt OWNER "The name of owner of the repository" "$AUTHOR_NAME" + +owner1="$(printf "%.1s" "$AUTHOR_NAME")" +owner2="${AUTHOR_NAME#* }" +if [ "$owner2" = "$AUTHOR_NAME" ]; then + owner_build="$(echo "$AUTHOR_NAME" | tr '[:upper:]' '[:lower:]')" +else + owner_build="$(echo "$owner1$owner2" | tr '[:upper:]' '[:lower:]')" +fi +prompt OWNER "The name of owner of the repository" "$owner_build" # nice meta data prompt DESCRIPTION "The description of this project" "" |