elm_install 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/elm_install/version.rb +1 -1
- data/package.json +3 -1
- data/packaging/Gemfile +1 -1
- data/scripts/install.js +33 -11
- data/scripts/run.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ac8a8d664399020fed3aab08c9f510dfc0b342
|
4
|
+
data.tar.gz: f4fcd64db986475dd59293484060510fd7a039fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84484f3b601baeb593ec56dc8fb751b015795a64855ede99038bd245f4cd379103c756a58d05264ce8f4d2cc6c76403fe57499e83346ba16590ba995cb4b9c18
|
7
|
+
data.tar.gz: 34745ee40861cf12e2511e6998b003239a09ac591defbd5f7889f0ad8d3aab0b0855ba6e17f49fb47f13d0d2be7d08865ae3480419236ff830ec8e2373d2a245
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/elm_install/version.rb
CHANGED
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "elm-github-install",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "Install Elm packages directly from Git repositories",
|
5
5
|
"scripts": {
|
6
6
|
"install": "node scripts/install.js",
|
@@ -16,7 +16,9 @@
|
|
16
16
|
},
|
17
17
|
"dependencies": {
|
18
18
|
"adm-zip": "^0.4.7",
|
19
|
+
"progress": "^2.0.0",
|
19
20
|
"request": "2.74.0",
|
21
|
+
"request-progress": "^3.0.0",
|
20
22
|
"shelljs": "0.7.5",
|
21
23
|
"tar-fs": "1.15.0",
|
22
24
|
"tmp": "^0.0.31"
|
data/packaging/Gemfile
CHANGED
data/scripts/install.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
var progress = require('request-progress')
|
2
|
+
var ProgressBar = require('progress')
|
1
3
|
var request = require('request')
|
2
|
-
var shell = require('shelljs')
|
3
4
|
var AdmZip = require('adm-zip')
|
5
|
+
var shell = require('shelljs')
|
4
6
|
var tar = require('tar-fs')
|
5
7
|
var path = require('path')
|
6
8
|
var zlib = require('zlib')
|
@@ -13,7 +15,11 @@ var version =
|
|
13
15
|
fs.readFileSync(versionPath, 'utf-8')
|
14
16
|
.match(/(\d+\.\d+\.\d+)/)[1]
|
15
17
|
|
16
|
-
var homedir = path.join(
|
18
|
+
var homedir = path.join(__dirname, 'dist-' + version)
|
19
|
+
|
20
|
+
// We already have that version downloaded
|
21
|
+
if(fs.existsSync(homedir)){ process.exit() }
|
22
|
+
|
17
23
|
var platform = os.platform()
|
18
24
|
var arch = process.arch
|
19
25
|
|
@@ -29,12 +35,31 @@ var packageUrl = function(suffix) {
|
|
29
35
|
].join('/')
|
30
36
|
}
|
31
37
|
|
32
|
-
var
|
33
|
-
|
34
|
-
'Downloading and extracting the binary from: ' + packageUrl(suffix))
|
38
|
+
var downloadRequest = function(url) {
|
39
|
+
var bar, lastTransferred
|
35
40
|
|
36
|
-
request
|
37
|
-
.
|
41
|
+
return progress(request.get(url))
|
42
|
+
.on("progress", function(data){
|
43
|
+
if (bar) {
|
44
|
+
bar.tick(data.size.transferred - lastTransferred)
|
45
|
+
lastTransferred = data.size.transferred
|
46
|
+
} else {
|
47
|
+
lastTransferred = 0
|
48
|
+
bar = new ProgressBar(
|
49
|
+
'Downloading and extracting the binary: [:bar] :rate/bps :percent :etas',
|
50
|
+
{
|
51
|
+
total: data.size.total,
|
52
|
+
incomplete: ' ',
|
53
|
+
complete: '=',
|
54
|
+
width: 60
|
55
|
+
}
|
56
|
+
)
|
57
|
+
}
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
var download = function(suffix){
|
62
|
+
downloadRequest(packageUrl(suffix))
|
38
63
|
.pipe(zlib.createGunzip())
|
39
64
|
.pipe(extractor)
|
40
65
|
}
|
@@ -53,10 +78,7 @@ if(platform === 'linux' && arch === 'x64') {
|
|
53
78
|
'elm-install-' + version + '-win32.zip'
|
54
79
|
].join('/')
|
55
80
|
|
56
|
-
|
57
|
-
|
58
|
-
request
|
59
|
-
.get(url)
|
81
|
+
downloadRequest(url)
|
60
82
|
.pipe(fs.createWriteStream(tmpFile.name))
|
61
83
|
.on('finish', function(){
|
62
84
|
var zip = new AdmZip(tmpFile.name)
|
data/scripts/run.js
CHANGED
@@ -10,7 +10,7 @@ var version =
|
|
10
10
|
fs.readFileSync(versionPath, 'utf-8')
|
11
11
|
.match(/(\d+\.\d+\.\d+)/)[1]
|
12
12
|
|
13
|
-
var homedir = path.join(
|
13
|
+
var homedir = path.join(__dirname, 'dist-' + version)
|
14
14
|
var platform = os.platform()
|
15
15
|
var arch = process.arch
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elm_install
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusztáv Szikszai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|