Skip to content

Commit cac8381

Browse files
committed
bugfix: resolve template pkg name as lowercase
1 parent e406583 commit cac8381

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"typescriptreact"
77
],
88
"editor.codeActionsOnSave": {
9-
"source.fixAll": true
9+
"source.fixAll": "explicit"
1010
},
1111
"[javascript]": {
1212
"editor.defaultFormatter": "esbenp.prettier-vscode"

bin/cb.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {Ora} from 'ora';
33
import shell from 'shelljs';
44
import {setTimeout} from 'timers';
55

6-
import {camelCaseToDash} from '../utils/functions.js';
6+
import {camelCaseToDash, camelCaseToLowerLetters} from '../utils/functions.js';
77

88
export const cbResultExpo = (
99
template: string,
@@ -35,7 +35,7 @@ export const cbResultExpo = (
3535
shell.sed(
3636
'-i',
3737
'dooboo',
38-
camelCaseToDash(`${nameOfApp}`),
38+
camelCaseToLowerLetters(`${nameOfApp}`),
3939
`./${nameOfApp}/app.config.ts`,
4040
);
4141

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/functions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export const camelCaseToDash = (str: string): string => {
8484
return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();
8585
};
8686

87+
export const camelCaseToLowerLetters = (str: string): string => {
88+
return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1').toLowerCase();
89+
};
90+
8791
export const camelize = (str: string): string => {
8892
return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) => {
8993
// or if (/\s+/.test(match)) for white spaces

0 commit comments

Comments
 (0)