Skip to content

Still fixing npm cache unpack when framework option is specified #1091

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
Oct 21, 2015
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
17 changes: 8 additions & 9 deletions lib/npm-installation-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,16 @@ export class NpmInstallationManager implements INpmInstallationManager {
private installCore(packageName: string, pathToSave: string, version: string): IFuture<string> {
return (() => {
if (this.$options.frameworkPath) {
if (this.$fs.getFsStats(this.$options.frameworkPath).wait().isFile()) {
this.npmInstall(packageName, pathToSave, version).wait();
let pathToNodeModules = path.join(pathToSave, "node_modules");
let folders = this.$fs.readDirectory(pathToNodeModules).wait();
this.npmInstall(packageName, pathToSave, version).wait();
let pathToNodeModules = path.join(pathToSave, "node_modules");
let folders = this.$fs.readDirectory(pathToNodeModules).wait();

let data = this.$fs.readJson(path.join(pathToNodeModules, folders[0], "package.json")).wait();
this.addToCache(data.name, data.version).wait();

return path.join(pathToNodeModules, folders[0]);
let data = this.$fs.readJson(path.join(pathToNodeModules, folders[0], "package.json")).wait();
if(!this.isPackageUnpacked(this.getCachedPackagePath(data.name, data.version), data.name).wait()) {
this.cacheUnpack(data.name, data.version).wait();
}
return this.$options.frameworkPath;

return path.join(pathToNodeModules, folders[0]);
} else {
version = version || this.getLatestCompatibleVersion(packageName).wait();
let packagePath = this.getCachedPackagePath(packageName, version);
Expand Down
2 changes: 1 addition & 1 deletion lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class PlatformService implements IPlatformService {
let installedVersion = this.$fs.readJson(path.join(frameworkDir, "../", "package.json")).wait().version;
platformData.platformProjectService.createProject(frameworkDir, installedVersion).wait();

if(this.$options.frameworkPath && this.$fs.getFsStats(this.$options.frameworkPath).wait().isFile() && !this.$options.symlink) {
if(this.$options.frameworkPath && !this.$options.symlink) {
// Need to remove unneeded node_modules folder
// One level up is the runtime module and one above is the node_modules folder.
this.$fs.deleteDirectory(path.join(frameworkDir, "../../")).wait();
Expand Down