Skip to content

fixed installed module name when uninstalling module #2259

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

Merged
merged 1 commit into from
Nov 28, 2016
Merged
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
10 changes: 6 additions & 4 deletions lib/services/project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ export class ProjectService implements IProjectService {
this.$logger.trace("Copying custom app into %s", projectAppDirectory);
appPath = customAppPath;
} else {
let defaultTemplatePath = this.$projectTemplatesService.prepareTemplate(selectedTemplate, projectDir).wait();
this.$logger.trace(`Copying application from '${defaultTemplatePath}' into '${projectAppDirectory}'.`);
appPath = defaultTemplatePath;
let templatePath = this.$projectTemplatesService.prepareTemplate(selectedTemplate, projectDir).wait();
this.$logger.trace(`Copying application from '${templatePath}' into '${projectAppDirectory}'.`);
let templatePackageJson = this.$fs.readJson(path.join(templatePath, "package.json")).wait();
selectedTemplate = templatePackageJson.name;
appPath = templatePath;
}

try {
Expand All @@ -78,7 +80,7 @@ export class ProjectService implements IProjectService {
this.$npm.install(projectDir, projectDir, { "ignore-scripts": this.$options.ignoreScripts }).wait();
selectedTemplate = selectedTemplate || "";
let templateName = (constants.RESERVED_TEMPLATE_NAMES[selectedTemplate.toLowerCase()] || selectedTemplate/*user template*/) || constants.RESERVED_TEMPLATE_NAMES["default"];
this.$npm.uninstall(templateName, {save: true}, projectDir).wait();
this.$npm.uninstall(selectedTemplate, {save: true}, projectDir).wait();

// TODO: plamen5kov: remove later (put only so tests pass (need to fix tests))
this.$logger.trace(`Using NativeScript verified template: ${templateName} with version undefined.`);
Expand Down