Skip to content

Commit

Permalink
Allow using the same app name
Browse files Browse the repository at this point in the history
  • Loading branch information
vomchik committed Jan 15, 2021
1 parent fd32427 commit 03ba1c7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ loadAppConfig()
.then(appConfig => {
const currentAppName = appConfig.name;
const nS_CurrentAppName = currentAppName.replace(/\s/g, '');
const lC_Ns_CurrentAppName = nS_CurrentAppName.toLowerCase();

program
.version(projectVersion)
.arguments('<newName>')
.arguments('[newName]')
.option('-b, --bundleID [value]', 'Set custom bundle identifier eg. "com.junedomingo.travelapp"')
.action(newName => {
.action((argName) => {
const newName = argName || currentAppName;
const nS_NewName = newName.replace(/\s/g, '');
const pattern = /^([\p{Letter}\p{Number}])+([\p{Letter}\p{Number}\s]+)$/u;
const bundleID = program.bundleID ? program.bundleID.toLowerCase() : null;
Expand Down Expand Up @@ -88,10 +88,6 @@ loadAppConfig()
);
}

if (newName === currentAppName || newName === nS_CurrentAppName || newName === lC_Ns_CurrentAppName) {
return console.log('Please try a different name.');
}

// Move files and folders from ./config/foldersAndFiles.js
const resolveFoldersAndFiles = new Promise(resolve => {
listOfFoldersAndFiles.forEach((element, index) => {
Expand Down

0 comments on commit 03ba1c7

Please sign in to comment.