Skip to content

Commit c746739

Browse files
Merge pull request #1090 from NativeScript/fatme/cache-package-with-frameworkPath
Cache packages that are added with --frameworkPath option
2 parents 80581ae + 035791a commit c746739

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/npm-installation-manager.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class NpmInstallationManager implements INpmInstallationManager {
4343
public addToCache(packageName: string, version: string): IFuture<void> {
4444
return (() => {
4545
let cachedPackagePath = this.getCachedPackagePath(packageName, version);
46-
if(!this.$fs.exists(cachedPackagePath).wait()) {
46+
if(!this.$fs.exists(cachedPackagePath).wait() || !this.$fs.exists(path.join(cachedPackagePath, "framework")).wait()) {
4747
this.addToCacheCore(packageName, version).wait();
4848
}
4949

@@ -155,6 +155,10 @@ export class NpmInstallationManager implements INpmInstallationManager {
155155
this.npmInstall(packageName, pathToSave, version).wait();
156156
let pathToNodeModules = path.join(pathToSave, "node_modules");
157157
let folders = this.$fs.readDirectory(pathToNodeModules).wait();
158+
159+
let data = this.$fs.readJson(path.join(pathToNodeModules, folders[0], "package.json")).wait();
160+
this.addToCache(data.name, data.version).wait();
161+
158162
return path.join(pathToNodeModules, folders[0]);
159163
}
160164
return this.$options.frameworkPath;

0 commit comments

Comments
 (0)