Skip to content

Commit

Permalink
Remove package name prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
friederbluemle committed Sep 11, 2020
1 parent 84d81d1 commit 2d164f9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 27 deletions.
6 changes: 2 additions & 4 deletions ern-local-cli/src/commands/create-api-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from 'ern-core';
import { generateApiImpl } from 'ern-api-impl-gen';
import {
askUserToInputPackageName,
askUserToSelectAnEnvironment,
epilog,
logErrorAndExitIfNotSatisfied,
Expand Down Expand Up @@ -168,11 +167,10 @@ export const commandHandler = async ({

// If no package name is specified get default name from apiImplName
if (!packageName) {
const defaultPackageName = (packageName = coreUtils.getDefaultPackageNameForModule(
packageName = coreUtils.getDefaultPackageNameForModule(
apiImplName,
moduleType,
));
packageName = await askUserToInputPackageName({ defaultPackageName });
);
}

// Check if packageName is valid
Expand Down
5 changes: 1 addition & 4 deletions ern-local-cli/src/commands/create-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
validateModuleName,
} from 'ern-core';
import {
askUserToInputPackageName,
epilog,
logErrorAndExitIfNotSatisfied,
performPkgNameConflictCheck,
Expand Down Expand Up @@ -99,13 +98,11 @@ export const commandHandler = async ({
);
}

// Construct the package name
if (!packageName) {
const defaultPackageName = coreUtils.getDefaultPackageNameForModule(
packageName = coreUtils.getDefaultPackageNameForModule(
apiName,
ModuleTypes.API,
);
packageName = await askUserToInputPackageName({ defaultPackageName });
}

await logErrorAndExitIfNotSatisfied({
Expand Down
4 changes: 1 addition & 3 deletions ern-local-cli/src/commands/create-miniapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
validateModuleName,
} from 'ern-core';
import {
askUserToInputPackageName,
epilog,
logErrorAndExitIfNotSatisfied,
performPkgNameConflictCheck,
Expand Down Expand Up @@ -131,11 +130,10 @@ export const commandHandler = async ({
}

if (!packageName) {
const defaultPackageName = coreUtils.getDefaultPackageNameForModule(
packageName = coreUtils.getDefaultPackageNameForModule(
appName,
ModuleTypes.MINIAPP,
);
packageName = await askUserToInputPackageName({ defaultPackageName });
}

if (packageManager === 'npm' || npm) {
Expand Down
15 changes: 0 additions & 15 deletions ern-local-cli/src/lib/askUserToInputPackageName.ts

This file was deleted.

1 change: 0 additions & 1 deletion ern-local-cli/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export { askUserForCodePushDeploymentName } from './askUserForCodePushDeployment
export { platformSupportedConfigAsString } from './platformSupportedConfigAsString';
export { tryCatchWrap } from './tryCatchWrap';
export { askUserToSelectAPlatform } from './askUserToSelectAPlatform';
export { askUserToInputPackageName } from './askUserToInputPackageName';
export { askUserToSelectAnEnvironment } from './askUserToSelectAnEnvironment';
export { askUserConfirmation } from './askUserConfirmation';
export { askUserForCodePushLabel } from './askUserForCodePushLabel';
Expand Down

0 comments on commit 2d164f9

Please sign in to comment.