@gregoriusrippenstein/node-red-contrib-nodedev 0.3.9 → 0.4.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.
@@ -66,6 +66,7 @@
66
66
  githubauthor: { value: ""},
67
67
  githubauthoremail: { value: "" },
68
68
  githubmessage: { value: "" },
69
+ githubgettar: { value: false },
69
70
 
70
71
  npmpublish: { value: false },
71
72
  npmunpublish: { value: false },
@@ -124,6 +125,16 @@
124
125
  }
125
126
  });
126
127
 
128
+ $('#node-input-githubgettar').on('change', () => {
129
+ if ( $('#node-input-githubgettar').is(":checked") ) {
130
+ $("#github-options").animate({opacity: 'show', height: 'show'}, 450);
131
+ } else {
132
+ if ( !$('#node-input-gitcheckforchange').is(":checked") && !$('#node-input-gitcommit').is(":checked") ) {
133
+ $("#github-options").animate({opacity: 'hide', height: 'hide'}, 450);
134
+ }
135
+ }
136
+ });
137
+
127
138
  $('#node-input-npmpublish').on('change', () => {
128
139
  if ( $('#node-input-npmpublish').is(":checked") ) {
129
140
  $("#npmpublish-options").animate({opacity: 'show', height: 'show'}, 450);
@@ -279,12 +290,17 @@
279
290
  <span>GitHub: Commit?</span>
280
291
  </label>
281
292
  <input type="checkbox" id="node-input-gitcommit" style="display:inline-block; width:15px; vertical-align:baseline;">
293
+
282
294
  <label for="node-input-gitcheckforchange" style="margin-left: 30px; min-width: 100px;">
283
295
  <span>What changed?</span>
284
296
  </label>
285
297
  <input type="checkbox" id="node-input-gitcheckforchange" style="display:inline-block; width:15px; vertical-align:baseline;">
286
- </div>
287
298
 
299
+ <label for="node-input-githubgettar" style="margin-left: 15px; min-width: 100px;">
300
+ <span>Get Repo?</span>
301
+ </label>
302
+ <input type="checkbox" id="node-input-githubgettar" style="display:inline-block; width:15px; vertical-align:baseline;">
303
+ </div>
288
304
 
289
305
  <div id="github-options">
290
306
  <div class="form-row">
@@ -4,6 +4,7 @@ module.exports = (function () {
4
4
  var streamx = require('streamx');
5
5
  var pakoGzip = require('pako');
6
6
  let pathUtil = require('path')
7
+ const buffer = require('buffer')
7
8
 
8
9
  /*
9
10
  * there is no indication in a tar file of whether a file is binary or textual.
@@ -98,10 +99,34 @@ module.exports = (function () {
98
99
  })
99
100
 
100
101
  extract.on('error', onError );
101
- var stream = streamx.Readable.from(Buffer.from(pakoGzip.inflate(new Uint8Array(tgzData))))
102
- stream.pipe(extract);
103
- }
104
102
 
103
+ try {
104
+ if (buffer.Buffer.isBuffer(tgzData)) {
105
+ import('file-type').then(module => {
106
+ module.fileTypeFromBuffer(tgzData).then(filetype => {
107
+ if ( filetype && filetype.ext == "tar") {
108
+ var stream = streamx.Readable.from(tgzData)
109
+ stream.pipe(extract);
110
+ } else {
111
+ var stream = streamx.Readable.from(Buffer.from(pakoGzip.inflate(new Uint8Array(tgzData))))
112
+ stream.pipe(extract);
113
+ }
114
+ }).catch(err => {
115
+ var stream = streamx.Readable.from(Buffer.from(pakoGzip.inflate(new Uint8Array(tgzData))))
116
+ stream.pipe(extract);
117
+ })
118
+ }).catch( e => {
119
+ var stream = streamx.Readable.from(Buffer.from(pakoGzip.inflate(new Uint8Array(tgzData))))
120
+ stream.pipe(extract);
121
+ })
122
+ } else {
123
+ var stream = streamx.Readable.from(Buffer.from(pakoGzip.inflate(new Uint8Array(tgzData))))
124
+ stream.pipe(extract);
125
+ }
126
+ } catch (ex) {
127
+ onError(ex)
128
+ }
129
+ }
105
130
 
106
131
  let exports = {
107
132
  computeFormat: computeFormat,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name" : "@gregoriusrippenstein/node-red-contrib-nodedev",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "dependencies": {
5
5
  "pako": "^2.1.0",
6
6
  "tar-stream": "^3.1.6",
@@ -9,7 +9,8 @@
9
9
  "streamx": "^2.15.5",
10
10
  "got": "^13",
11
11
  "pacote": "^17.0.4",
12
- "otpauth": "^5.0.8"
12
+ "otpauth": "^5.0.8",
13
+ "file-type": ">=18.7.0"
13
14
  },
14
15
 
15
16
  "keywords": [