@microtica/code-repository
Advanced tools
Comparing version 0.1.18 to 0.1.19
@@ -6,2 +6,4 @@ "use strict"; | ||
const through = require("through2"); | ||
const unzip = require("unzip-stream"); | ||
const archiver = require("archiver"); | ||
class Bitbucket { | ||
@@ -99,15 +101,16 @@ constructor(credentials) { | ||
const output = through(); | ||
// const archive = archiver('zip', { | ||
// zlib: { level: 9 } | ||
// }); | ||
// archive.pipe(output); | ||
const archive = archiver('zip', { | ||
zlib: { level: 9 } | ||
}); | ||
archive.pipe(output); | ||
request(`https://${this.credentials.username}:${this.credentials.password}@bitbucket.org/${repoName}/get/${version}.zip`).pipe(stream); | ||
// stream.pipe(unzip.Parse()) | ||
// .on('entry', (entry: Buffer & { path: string }) => { | ||
// const name = entry.path.substring(entry.path.indexOf('/') + 1); | ||
// if (!name) return; | ||
// archive.append(entry, { name: entry.path.substring(entry.path.indexOf('/') + 1) }) | ||
// }); | ||
// stream.on('finish', () => archive.finalize()); | ||
return stream; | ||
stream.pipe(unzip.Parse()) | ||
.on('entry', (entry) => { | ||
const name = entry.path.substring(entry.path.indexOf('/') + 1); | ||
if (!name) | ||
return; | ||
archive.append(entry, { name: entry.path.substring(entry.path.indexOf('/') + 1) }); | ||
}); | ||
stream.on('finish', () => archive.finalize()); | ||
return output; | ||
} | ||
@@ -114,0 +117,0 @@ } |
{ | ||
"name": "@microtica/code-repository", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "Integration module with git repository providers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13061
187