@wavemaker/angular-codegen 11.7.0-next.42251 → 11.7.0-rc.5524

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,7 @@ const downloadNPMPackage = (packageInfo) => {
32
32
  const HOME_DIR = os.homedir();
33
33
  const PATH_NPM_PACKAGE = (packageInfo.baseDir || HOME_DIR + '/.wm/node_modules/') + packageInfo.name + '/' + packageInfo.version;
34
34
  const PATH_NPM_PACKAGE_SUCCESS = PATH_NPM_PACKAGE + '/.SUCCESS';
35
+ let isError = false;
35
36
 
36
37
  // To check global app runtime node modules.
37
38
  if (!isNPMPackageExist(PATH_NPM_PACKAGE_SUCCESS, packageInfo.successMsg)) {
@@ -44,10 +45,16 @@ const downloadNPMPackage = (packageInfo) => {
44
45
  }
45
46
 
46
47
  executeSyncCmd('cd ' + PATH_NPM_PACKAGE + ' && ' + npmInstallCMD, (errMsg) => {
48
+ isError = true;
47
49
  console.log(packageInfo.infoMsg + ' Something wrong with npm installation ', errMsg);
48
50
  }, packageInfo.infoMsg);
49
51
 
50
- fs.writeFileSync(PATH_NPM_PACKAGE_SUCCESS, packageInfo.successMsg);
52
+ //only create a .SUCCESS file when there is no error
53
+ if(!isError) {
54
+ isError = false;
55
+ fs.writeFileSync(PATH_NPM_PACKAGE_SUCCESS, packageInfo.successMsg);
56
+ }
57
+
51
58
  } else {
52
59
  console.log(packageInfo.infoMsg + ' Node packages already installed!');
53
60
  }