node-nightly 1.7.3 → 1.8.0
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.
- package/cli.js +18 -12
- package/index.js +16 -9
- package/package.json +8 -7
- package/History.md +0 -136
package/cli.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {spawn} from 'cross-spawn';
|
|
4
|
+
import nodeNightly from './index.js';
|
|
5
|
+
import gracefulFs from 'graceful-fs';
|
|
6
|
+
import isOnline from 'is-online';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import {fileURLToPath} from 'url';
|
|
9
|
+
|
|
10
|
+
const {existsSync} = gracefulFs;
|
|
7
11
|
|
|
8
12
|
const os = process.platform === 'win32' ? 'win' : process.platform;
|
|
9
13
|
let args = process.argv.slice(2);
|
|
10
14
|
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = path.dirname(__filename);
|
|
17
|
+
|
|
11
18
|
// Check for upgrade.
|
|
12
19
|
let upgradeIndex = args.indexOf('--upgrade'),
|
|
13
20
|
versionIndex = args.indexOf('--version'),
|
|
@@ -15,16 +22,15 @@ let upgradeIndex = args.indexOf('--upgrade'),
|
|
|
15
22
|
|
|
16
23
|
if (version) {
|
|
17
24
|
nodeNightly.install(version).catch(console.error);
|
|
18
|
-
}
|
|
19
|
-
else if(!!~upgradeIndex) {
|
|
25
|
+
} else if (!!~upgradeIndex) {
|
|
20
26
|
reportIfOffline();
|
|
21
27
|
nodeNightly.update().then(res => {
|
|
22
|
-
if(res !== 'Installed') {
|
|
28
|
+
if (res !== 'Installed') {
|
|
23
29
|
console.log(res);
|
|
24
30
|
}
|
|
25
31
|
process.exit(0);
|
|
26
32
|
}).catch(console.error);
|
|
27
|
-
} else if(!existsSync(`${__dirname}/node-nightly`)) {
|
|
33
|
+
} else if (!existsSync(`${__dirname}/node-nightly`)) {
|
|
28
34
|
|
|
29
35
|
console.log('Downloading the nightly version, hang on...');
|
|
30
36
|
reportIfOffline();
|
|
@@ -33,12 +39,12 @@ else if(!!~upgradeIndex) {
|
|
|
33
39
|
} else {
|
|
34
40
|
|
|
35
41
|
nodeNightly.check().then(updatedVersion => {
|
|
36
|
-
if(updatedVersion) {
|
|
42
|
+
if (updatedVersion) {
|
|
37
43
|
console.log('\x1b[36m', 'New nightly available. To upgrade: `node-nightly --upgrade`' ,'\x1b[0m');
|
|
38
44
|
}
|
|
39
|
-
if(os === 'win'){
|
|
45
|
+
if (os === 'win') {
|
|
40
46
|
spawn(`${__dirname}/node-nightly/node`, args, {stdio: 'inherit', env: process.env});
|
|
41
|
-
} else{
|
|
47
|
+
} else {
|
|
42
48
|
spawn(`${__dirname}/node-nightly/bin/node`, args, {stdio: 'inherit', env: process.env});
|
|
43
49
|
}
|
|
44
50
|
}).catch(console.error);
|
|
@@ -46,7 +52,7 @@ else if(!!~upgradeIndex) {
|
|
|
46
52
|
|
|
47
53
|
function reportIfOffline() {
|
|
48
54
|
isOnline((err, online) => {
|
|
49
|
-
if(!online) {
|
|
55
|
+
if (!online) {
|
|
50
56
|
//offline
|
|
51
57
|
console.info('\x1b[31m', 'Please check your internet connectivity.','\x1b[0m');
|
|
52
58
|
process.exit(0);
|
package/index.js
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import download from 'download';
|
|
3
|
+
import nodeNightlyVersion from 'node-nightly-version';
|
|
4
|
+
import Configstore from 'configstore';
|
|
5
|
+
import rm from 'rimraf';
|
|
6
|
+
import realFs from 'fs';
|
|
7
|
+
import gracefulFs from 'graceful-fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import {fileURLToPath} from 'url';
|
|
10
|
+
|
|
11
|
+
const pkg = JSON.parse(gracefulFs.readFileSync('./package.json', 'utf-8'));
|
|
12
|
+
|
|
9
13
|
gracefulFs.gracefulify(realFs);
|
|
10
14
|
const mv = gracefulFs.renameSync;
|
|
11
15
|
|
|
12
|
-
const extractDate = versionString => ~~versionString.split('nightly'
|
|
16
|
+
const extractDate = versionString => ~~versionString.split('nightly'[1].slice(0, 8));
|
|
13
17
|
const compVersion = (currentVersion, latestVersion) => extractDate(currentVersion) < extractDate(latestVersion);
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
const __dirname = path.dirname(__filename);
|
|
21
|
+
|
|
22
|
+
export default {
|
|
16
23
|
|
|
17
24
|
install: (version) => {
|
|
18
25
|
let osArchString, nodeNightlyVer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-nightly",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "node-nightly at your finger tips!",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "hemanth/node-nightly",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"email": "hemanth.hm@gmail.com",
|
|
10
10
|
"url": "h3manth.com"
|
|
11
11
|
},
|
|
12
|
+
"type": "module",
|
|
12
13
|
"scripts": {
|
|
13
14
|
"test": "node cli.js -v"
|
|
14
15
|
},
|
|
@@ -33,12 +34,12 @@
|
|
|
33
34
|
"nightly"
|
|
34
35
|
],
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"configstore": "^
|
|
37
|
-
"cross-spawn": "
|
|
38
|
-
"download": "^
|
|
39
|
-
"graceful-fs": "^4.
|
|
40
|
-
"is-online": "^
|
|
37
|
+
"configstore": "^6.0.0",
|
|
38
|
+
"cross-spawn": "7.0.3",
|
|
39
|
+
"download": "^8.0.0",
|
|
40
|
+
"graceful-fs": "^4.2.9",
|
|
41
|
+
"is-online": "^9.0.1",
|
|
41
42
|
"node-nightly-version": "^1.0.6",
|
|
42
|
-
"rimraf": "^
|
|
43
|
+
"rimraf": "^3.0.2"
|
|
43
44
|
}
|
|
44
45
|
}
|
package/History.md
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
v1.6.0 / 2016-08-22
|
|
2
|
-
===================
|
|
3
|
-
|
|
4
|
-
* 1.6.0
|
|
5
|
-
* updated node-nightly-version
|
|
6
|
-
* Updated the deps
|
|
7
|
-
|
|
8
|
-
v1.5.1 / 2016-08-18
|
|
9
|
-
===================
|
|
10
|
-
|
|
11
|
-
* 1.5.1
|
|
12
|
-
* updated node-nightly-version
|
|
13
|
-
* node-nightly-version bump.
|
|
14
|
-
* feat: Check for internet connectivity when upgrading/installing (#26)
|
|
15
|
-
|
|
16
|
-
v1.5.0 / 2016-08-09
|
|
17
|
-
===================
|
|
18
|
-
|
|
19
|
-
* 1.5.0
|
|
20
|
-
* Add Windows Compability! (#24)
|
|
21
|
-
* fix: Use graceful-fs everywhere to maintain consistency (#20)
|
|
22
|
-
|
|
23
|
-
v1.4.2 / 2016-07-24
|
|
24
|
-
===================
|
|
25
|
-
|
|
26
|
-
* 1.4.2
|
|
27
|
-
* refactor: use graceful-fs (#18)
|
|
28
|
-
|
|
29
|
-
v1.4.1 / 2016-07-15
|
|
30
|
-
===================
|
|
31
|
-
|
|
32
|
-
* 1.4.1
|
|
33
|
-
* Add `publishConfig` to package (#16)
|
|
34
|
-
|
|
35
|
-
v1.4.0 / 2016-07-14
|
|
36
|
-
===================
|
|
37
|
-
|
|
38
|
-
* 1.4.0
|
|
39
|
-
* Update in how install and update works together (#15)
|
|
40
|
-
* Rewrite phase-I
|
|
41
|
-
* Promises anti-pattern removed (#9)
|
|
42
|
-
|
|
43
|
-
v1.3.4 / 2016-07-06
|
|
44
|
-
===================
|
|
45
|
-
|
|
46
|
-
* 1.3.4
|
|
47
|
-
* Travis badge
|
|
48
|
-
* Merge pull request #13 from cnpm/fix-extend
|
|
49
|
-
* fix: file ext should be .tar.gz
|
|
50
|
-
* Merge pull request #12 from tarungarg546/unused
|
|
51
|
-
* Removed unused variable from cli.js
|
|
52
|
-
* Merge pull request #11 from cnpm/download-from-mirror
|
|
53
|
-
* feat: support download from mirror
|
|
54
|
-
|
|
55
|
-
v1.3.3 / 2016-07-02
|
|
56
|
-
===================
|
|
57
|
-
|
|
58
|
-
* 1.3.3
|
|
59
|
-
* available typo :cactus:
|
|
60
|
-
* Merge pull request #8 from paulirish/patch-2
|
|
61
|
-
* fix spelling typo
|
|
62
|
-
|
|
63
|
-
v1.3.2 / 2016-06-30
|
|
64
|
-
===================
|
|
65
|
-
|
|
66
|
-
* 1.3.2
|
|
67
|
-
* No more prompts.
|
|
68
|
-
|
|
69
|
-
v1.3.1 / 2016-06-29
|
|
70
|
-
===================
|
|
71
|
-
|
|
72
|
-
* 1.3.1
|
|
73
|
-
* Merge pull request #6 from paulirish/patch-1
|
|
74
|
-
* dirname duh duh :)
|
|
75
|
-
|
|
76
|
-
v1.3.0 / 2016-06-28
|
|
77
|
-
===================
|
|
78
|
-
|
|
79
|
-
* 1.3.0
|
|
80
|
-
* __dirname duh 💩
|
|
81
|
-
|
|
82
|
-
v1.2.1 / 2016-06-28
|
|
83
|
-
===================
|
|
84
|
-
|
|
85
|
-
* 1.2.1
|
|
86
|
-
* execvp logic shift
|
|
87
|
-
|
|
88
|
-
v1.2.0 / 2016-06-28
|
|
89
|
-
===================
|
|
90
|
-
|
|
91
|
-
* 1.2.0
|
|
92
|
-
* --upgrade flag and less noise, as per @paulirish's suggestion
|
|
93
|
-
|
|
94
|
-
v1.1.4 / 2016-06-28
|
|
95
|
-
===================
|
|
96
|
-
|
|
97
|
-
* 1.1.4
|
|
98
|
-
* yesno is not needed now.
|
|
99
|
-
|
|
100
|
-
v1.1.3 / 2016-06-28
|
|
101
|
-
===================
|
|
102
|
-
|
|
103
|
-
* 1.1.3
|
|
104
|
-
* Clean up
|
|
105
|
-
|
|
106
|
-
v1.1.2 / 2016-06-28
|
|
107
|
-
===================
|
|
108
|
-
|
|
109
|
-
* 1.1.2
|
|
110
|
-
* Fixes #1
|
|
111
|
-
|
|
112
|
-
v1.1.1 / 2016-06-27
|
|
113
|
-
===================
|
|
114
|
-
|
|
115
|
-
* 1.1.1
|
|
116
|
-
* gif 🤓
|
|
117
|
-
|
|
118
|
-
v1.1.0 / 2016-06-27
|
|
119
|
-
===================
|
|
120
|
-
|
|
121
|
-
* 1.1.0
|
|
122
|
-
* Notify and update on nightly + gif 🤓
|
|
123
|
-
* using node-nightly-version module
|
|
124
|
-
|
|
125
|
-
v1.0.1 / 2016-06-25
|
|
126
|
-
===================
|
|
127
|
-
|
|
128
|
-
* 1.0.1
|
|
129
|
-
* >=4
|
|
130
|
-
* no tests for now
|
|
131
|
-
|
|
132
|
-
v1.0.0 / 2016-06-25
|
|
133
|
-
===================
|
|
134
|
-
|
|
135
|
-
* 1.0.0
|
|
136
|
-
* 🐜
|