Skip to content

Commit 084c483

Browse files
authored
Merge pull request #38 from jamessessford/pascal-case-vendor
Pascal case vendor name
2 parents 9012b5c + aa24724 commit 084c483

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

configure-skeleton.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ author_username=$(ask_question "Author username" "$username_guess")
3535
current_directory=$(pwd)
3636
folder_name=$(basename "$current_directory")
3737

38-
vendor_name_unsantized=$(ask_question "Vendor name" "$author_name")
38+
vendor_name_unsanitized=$(ask_question "Vendor name" "$author_name")
3939
package_name=$(ask_question "Package name" "$folder_name")
4040
package_description=$(ask_question "Package description" "$package_name")
4141

4242
# convert my-class-title to MyClassTitle - RODO: use to subsctitute ./src/*
4343
class_name=$(echo "$package_name" | sed 's/[-_]/ /g' | awk '{for(j=1;j<=NF;j++){ $j=toupper(substr($j,1,1)) substr($j,2) }}1' | sed 's/[[:space:]]//g')
4444

45-
vendor_name_lower_case=`echo "$vendor_name_unsantized" | tr '[:upper:]' '[:lower:]'`
45+
vendor_name_pascal_case=`echo "$vendor_name_unsanitized" | sed -r 's/(^|-)(\w)/\U\2/g'`
46+
vendor_name_lower_case=`echo "$vendor_name_unsanitized" | tr '[:upper:]' '[:lower:]'`
4647
vendor_name="$(tr '[:lower:]' '[:upper:]' <<< ${vendor_name_lower_case:0:1})${vendor_name_lower_case:1}"
4748

4849
echo
@@ -67,7 +68,7 @@ for file in $files ; do
6768
| sed "s/:author_email/$author_email/g" \
6869
| sed "s/:author_homepage/$author_homepage/g" \
6970
| sed "s/:package_name/$package_name/g" \
70-
| sed "s/Spatie/$vendor_name/g" \
71+
| sed "s/Spatie/$vendor_name_pascal_case/g" \
7172
| sed "s/Skeleton/$class_name/g" \
7273
| sed "s/:vendor_name/$vendor_name_lower_case/g" \
7374
| sed "s/:package_description/$package_description/g" \

0 commit comments

Comments
 (0)