Skip to content

Commit

Permalink
Revert "chore: remove ensureInitialized"
Browse files Browse the repository at this point in the history
This reverts commit 96483ce.
  • Loading branch information
0618 committed Dec 18, 2023
1 parent 96483ce commit 7c59c80
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/create-amplify/src/amplify_project_creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AmplifyProjectCreator {
logger.debug(`Validating current state of target directory...`);
await this.projectRootValidator.validate();

await this.packageManagerController.initializeAmplifyFolder();
await this.packageManagerController.ensureInitialized();

await logger.indicateProgress(
`Installing required dependencies`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export class NpmPackageManagerController implements PackageManagerController {
);
};

ensureInitialized = async () => {
await this.packageManagerControllerFactory.initializeProject(
this.packageManagerProps
);
};

getWelcomeMessage = () => {
const cdCommand =
process.cwd() === this.projectRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export abstract class PackageManagerController {
packageNames: string[],
type: DependencyType
) => Promise<void>;
abstract ensureInitialized: () => Promise<void>;
abstract getWelcomeMessage: () => string;
abstract generateInitialProjectFiles: () => Promise<void>;
abstract initializeAmplifyFolder: () => Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export class PnpmPackageManagerController implements PackageManagerController {
);
};

ensureInitialized = async () => {
await this.packageManagerControllerFactory.initializeProject(
this.packageManagerProps
);
};

getWelcomeMessage = () => {
const cdCommand =
process.cwd() === this.projectRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export class YarnClassicPackageManagerController
);
};

ensureInitialized = async () => {
await this.packageManagerControllerFactory.initializeProject(
this.packageManagerProps
);
};

getWelcomeMessage = () => {
const cdCommand =
process.cwd() === this.projectRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export class YarnModernPackageManagerController
);
};

ensureInitialized = async () => {
await this.packageManagerControllerFactory.initializeProject(
this.packageManagerProps
);
};

getWelcomeMessage = () => {
const cdCommand =
process.cwd() === this.projectRoot
Expand Down

0 comments on commit 7c59c80

Please sign in to comment.