diff --git a/packages/amplify-frontend-javascript/lib/configuration-manager.js b/packages/amplify-frontend-javascript/lib/configuration-manager.js index 165b016858f..98e247123aa 100644 --- a/packages/amplify-frontend-javascript/lib/configuration-manager.js +++ b/packages/amplify-frontend-javascript/lib/configuration-manager.js @@ -170,7 +170,7 @@ function displayFrontendDefaults(context, projectPath) { context.print.info(`| App type: javascript`); const defaultFramework = guessFramework(context, projectPath); - const projectConfiguration = getProjectConfiguration(context, defaultFramework); + const projectConfiguration = getProjectConfiguration(context, defaultFramework, projectPath); context.print.info(`| Javascript framework: ${defaultFramework}`); context.print.info(`| Source Directory Path: ${projectConfiguration.SourceDir}`); diff --git a/packages/amplify-frontend-javascript/lib/framework-config-mapping.js b/packages/amplify-frontend-javascript/lib/framework-config-mapping.js index 4c57dfb0e2a..f36e9424338 100644 --- a/packages/amplify-frontend-javascript/lib/framework-config-mapping.js +++ b/packages/amplify-frontend-javascript/lib/framework-config-mapping.js @@ -53,8 +53,8 @@ const defaultConfig = { StartCommand: `${npm} run-script start`, }; -function getAngularConfig(context) { - const projectRoot = context.exeInfo.localEnvInfo.projectPath; +function getAngularConfig(context, projectPath) { + const projectRoot = projectPath || context.exeInfo.localEnvInfo.projectPath; const angularConfigFile = path.join(projectRoot, 'angular.json'); let angularProjectConfig; try { @@ -79,10 +79,10 @@ function getAngularConfig(context) { }; } -function getProjectConfiguration(context, framework) { +function getProjectConfiguration(context, framework, projectPath) { switch (framework) { case 'angular': - return getAngularConfig(context); + return getAngularConfig(context, projectPath); case 'ember': return emberConfig; case 'ionic':