node-install-release 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,6 @@
1
1
  var path = require('path');
2
+ var access = require('fs-access-compat');
3
+ var rimraf = require('rimraf');
2
4
 
3
5
  var conditionalCache = require('../conditionalCache');
4
6
  var conditionalExtract = require('../conditionalExtract');
@@ -10,9 +12,17 @@ module.exports = function installCompressed(relativePath, dest, record, options,
10
12
 
11
13
  conditionalCache(downloadPath, cachePath, function (err) {
12
14
  if (err) return callback(err);
13
- conditionalExtract(cachePath, dest, Object.assign({ strip: 1, progress: progress, time: 1000 }, options), function (err) {
14
- console.log('');
15
- callback(err);
15
+ access(dest, function (err) {
16
+ if (!err) return callback(); // already exists
17
+ conditionalExtract(cachePath, dest, Object.assign({ strip: 1, progress: progress, time: 1000 }, options), function (err) {
18
+ console.log('');
19
+ if (err) return callback(err);
20
+
21
+ // some compressed versions of node come with npm pre-installed, but we want to override
22
+ rimraf(path.join(dest, 'node_modules'), function () {
23
+ callback(err);
24
+ });
25
+ });
16
26
  });
17
27
  });
18
28
  };
@@ -1,8 +1,8 @@
1
1
  var path = require('path');
2
+ var access = require('fs-access-compat');
2
3
 
3
4
  var conditionalCache = require('../conditionalCache');
4
5
  var copyFile = require('../copyFile');
5
- var access = require('fs-access-compat');
6
6
 
7
7
  module.exports = function installExe(relativePath, dest, record, options, callback) {
8
8
  var downloadPath = options.downloadURL(relativePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-install-release",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Cross-platform solution for installing releases of Node.js",
5
5
  "keywords": [
6
6
  "node",