@@ -151,17 +151,16 @@ export class NpmInstallationManager implements INpmInstallationManager {
151
151
private installCore ( packageName : string , pathToSave : string , version : string ) : IFuture < string > {
152
152
return ( ( ) => {
153
153
if ( this . $options . frameworkPath ) {
154
- if ( this . $fs . getFsStats ( this . $options . frameworkPath ) . wait ( ) . isFile ( ) ) {
155
- this . npmInstall ( packageName , pathToSave , version ) . wait ( ) ;
156
- let pathToNodeModules = path . join ( pathToSave , "node_modules" ) ;
157
- let folders = this . $fs . readDirectory ( pathToNodeModules ) . wait ( ) ;
154
+ this . npmInstall ( packageName , pathToSave , version ) . wait ( ) ;
155
+ let pathToNodeModules = path . join ( pathToSave , "node_modules" ) ;
156
+ let folders = this . $fs . readDirectory ( pathToNodeModules ) . wait ( ) ;
158
157
159
- let data = this . $fs . readJson ( path . join ( pathToNodeModules , folders [ 0 ] , "package.json" ) ) . wait ( ) ;
160
- this . addToCache ( data . name , data . version ) . wait ( ) ;
161
-
162
- return path . join ( pathToNodeModules , folders [ 0 ] ) ;
158
+ let data = this . $fs . readJson ( path . join ( pathToNodeModules , folders [ 0 ] , "package.json" ) ) . wait ( ) ;
159
+ if ( ! this . isPackageUnpacked ( this . getCachedPackagePath ( data . name , data . version ) , data . name ) . wait ( ) ) {
160
+ this . cacheUnpack ( data . name , data . version ) . wait ( ) ;
163
161
}
164
- return this . $options . frameworkPath ;
162
+
163
+ return path . join ( pathToNodeModules , folders [ 0 ] ) ;
165
164
} else {
166
165
version = version || this . getLatestCompatibleVersion ( packageName ) . wait ( ) ;
167
166
let packagePath = this . getCachedPackagePath ( packageName , version ) ;
0 commit comments