Skip to content

Commit ce3588e

Browse files
authored
0.1.5: less chatty (#2)
1 parent 3b78513 commit ce3588e

File tree

3 files changed

+60
-31
lines changed

3 files changed

+60
-31
lines changed

package-lock.json

Lines changed: 42 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oras-pull",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "ORAS pull for ghcr.io",
55
"scripts": {
66
"test": "tsc && npm run pull",
@@ -27,9 +27,9 @@
2727
},
2828
"homepage": "https://github.com/heliconialabs/oras-pull#readme",
2929
"devDependencies": {
30-
"@types/node": "^18.11.18",
31-
"@types/tar": "^6.1.3",
32-
"typescript": "^4.9.4"
30+
"@types/node": "^18.14.4",
31+
"@types/tar": "^6.1.4",
32+
"typescript": "^4.9.5"
3333
},
3434
"dependencies": {
3535
"cross-fetch": "^3.1.5",

src/cli.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,23 @@ async function run() {
7171
const readableStream = stream.Readable.from(responseBuffer);
7272

7373
console.log("");
74-
readableStream.pipe(
74+
let count = 0;
75+
const st = readableStream.pipe(
7576
tar.extract({
76-
onentry: entry => { console.log("Extract: " + entry.path); }
77+
onentry: entry => {
78+
count++;
79+
if (count < 10) {
80+
console.log("Extract: " + entry.path);
81+
} else if (count % 100 === 0) {
82+
console.log(count);
83+
}
84+
}
7785
})
7886
);
87+
st.on('finish', () => {
88+
console.log(count + " folders/files extracted");
89+
});
90+
7991
}
8092

8193
run().then(() => {

0 commit comments

Comments
 (0)