Skip to content

Commit 4135a24

Browse files
authored
fix: check amplify/backend to determine project existence (#6115)
1 parent a3235b4 commit 4135a24

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/amplify-app/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async function amplifyCLIVersionCheck() {
146146
* @returns {Promise<void>}
147147
*/
148148
const createAmplifySkeletonProject = async frontend => {
149-
if (fs.existsSync('./amplify') && frontend !== 'ios') {
149+
if (fs.existsSync(path.join('.', 'amplify', 'backend')) && frontend !== 'ios') {
150150
console.log(
151151
`An Amplify project is already initialized in your current working directory ${emoji.get('smiley')}. Not generating base project.\n`,
152152
);
@@ -421,7 +421,7 @@ async function createIosHelperFiles() {
421421
fs.writeFileSync(amplifyConfigFile, configJsonStr);
422422
}
423423

424-
if (fs.existsSync(amplifyDir)) {
424+
if (fs.existsSync(path.join(amplifyDir, 'backend'))) {
425425
await addAmplifyFiles();
426426
}
427427
}

packages/amplify-cli/src/pre-deployment-pull.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function preDeployPullBackend(context: $TSContext, sandboxId: strin
4141
}
4242

4343
// Create base-skeleton amplify-folder
44-
const amplifyDirPath = pathManager.getAmplifyDirPath(process.cwd());
44+
const amplifyDirPath = pathManager.getBackendDirPath(process.cwd());
4545
if (!fs.existsSync(amplifyDirPath)) {
4646
await run({ skipEnvCheck: true });
4747
}

0 commit comments

Comments
 (0)