Skip to content

Commit

Permalink
Merge pull request #192 from raheemazeezabiodun/update-message
Browse files Browse the repository at this point in the history
bugfix: show selected package manager after install
  • Loading branch information
kamilmysliwiec authored Nov 5, 2018
2 parents 5a8920a + 0df0792 commit c243d59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions actions/new.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ const installPackages = async (inputs: Input[], options: Input[]) => {
if (inputPackageManager !== undefined) {
try {
packageManager = PackageManagerFactory.create(inputPackageManager);
await packageManager.install(installDirectory);
await packageManager.install(installDirectory, inputPackageManager);
} catch (error) {
if (error && error.message) {
console.error(chalk.red(error.message));
}
}
} else {
packageManager = await selectPackageManager();
await packageManager.install(installDirectory);
await packageManager.install(installDirectory, packageManager.name.toLowerCase());
}
};

Expand Down
4 changes: 2 additions & 2 deletions lib/package-managers/abstract.package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ProjectDependency } from './project.dependency';
export abstract class AbstractPackageManager {
constructor(protected runner: AbstractRunner) {}

public async install(directory: string) {
public async install(directory: string, packageManager: string) {
const spinner = ora({
spinner: {
interval: 120,
Expand All @@ -38,7 +38,7 @@ export abstract class AbstractPackageManager {
console.info(messages.GET_STARTED_INFORMATION);
console.info();
console.info(chalk.gray(messages.CHANGE_DIR_COMMAND(directory)));
console.info(chalk.gray(messages.START_COMMAND));
console.info(chalk.gray(messages.START_COMMAND(packageManager)));
console.info();
} catch {
spinner.fail();
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const messages = {
emojis.POINT_RIGHT
} Get started with the following commands:`,
CHANGE_DIR_COMMAND: (name: string) => `$ cd ${name}`,
START_COMMAND: '$ npm run start',
START_COMMAND: (name: string) => `$ ${name} run start`,
PACKAGE_MANAGER_INSTALLATION_FAILED: `${
emojis.SCREAM
} Packages installation failed, see above`,
Expand Down

0 comments on commit c243d59

Please sign in to comment.