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

add App_Resources from default template if missing #2513 #2609

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

yyosifov
Copy link
Contributor

If the template specified by the --template parameter doesn't contain the App_Resources folder, we take the App_Resources folder from the default template and use that instead.

Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! My comments are minor and not a merge stopper.

@@ -102,6 +104,27 @@ export class ProjectService implements IProjectService {
this.$fs.createDirectory(path.join(projectDir, "platforms"));
}

private async ensureAppResourcesExist(projectDir: string): Promise<void> {
let appPath = path.join(projectDir, constants.APP_FOLDER_NAME),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these could be const instead of let

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree const is the better approach. I'll leave it as let now, following the whole style of the file - where all other same-constructed paths are with let. I'll take care to use const in the future :)

// the template installed doesn't have App_Resources -> get from a default template
let defaultTemplateName = constants.RESERVED_TEMPLATE_NAMES["default"];
await this.$npm.install(defaultTemplateName, projectDir, { save: true, });
let defaultTemplateAppResourcesPath = path.join(projectDir, constants.NODE_MODULES_FOLDER_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here - these could be const

@yyosifov yyosifov merged commit 0d3e921 into master Mar 15, 2017
@yyosifov yyosifov deleted the yosifov/create-default-app-resources branch March 27, 2017 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants