@gregoriusrippenstein/node-red-contrib-nodedev 0.3.9 → 0.4.1

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,17 @@
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
+ $('#node-input-ignore_package_check').prop('checked',true)
132
+ } else {
133
+ if ( !$('#node-input-gitcheckforchange').is(":checked") && !$('#node-input-gitcommit').is(":checked") ) {
134
+ $("#github-options").animate({opacity: 'hide', height: 'hide'}, 450);
135
+ }
136
+ }
137
+ });
138
+
127
139
  $('#node-input-npmpublish').on('change', () => {
128
140
  if ( $('#node-input-npmpublish').is(":checked") ) {
129
141
  $("#npmpublish-options").animate({opacity: 'show', height: 'show'}, 450);
@@ -279,12 +291,17 @@
279
291
  <span>GitHub: Commit?</span>
280
292
  </label>
281
293
  <input type="checkbox" id="node-input-gitcommit" style="display:inline-block; width:15px; vertical-align:baseline;">
294
+
282
295
  <label for="node-input-gitcheckforchange" style="margin-left: 30px; min-width: 100px;">
283
296
  <span>What changed?</span>
284
297
  </label>
285
298
  <input type="checkbox" id="node-input-gitcheckforchange" style="display:inline-block; width:15px; vertical-align:baseline;">
286
- </div>
287
299
 
300
+ <label for="node-input-githubgettar" style="margin-left: 15px; min-width: 100px;">
301
+ <span>Get Repo?</span>
302
+ </label>
303
+ <input type="checkbox" id="node-input-githubgettar" style="display:inline-block; width:15px; vertical-align:baseline;">
304
+ </div>
288
305
 
289
306
  <div id="github-options">
290
307
  <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.1",
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": [