Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amplify-frontend-javascript): add project path to angular #7069

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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':
Expand Down