Skip to content

Commit c835873

Browse files
v0.2.2 (#19)
* [Fix]: update spinner output * [Update]: version to v0.2.2 * [Update]: README.md
1 parent 64f5ed7 commit c835873

5 files changed

Lines changed: 20 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Simple NodeJS CLI which allows you zip and unzip files with support for .gitigno
1010
Install it locally with
1111

1212
```bash
13-
npm i https://github.com/matteosacchetto/node-zip-cli/releases/download/v0.2.1/node-zip-cli-0.2.1.tgz
13+
npm i https://github.com/matteosacchetto/node-zip-cli/releases/download/v0.2.2/node-zip-cli-0.2.2.tgz
1414
```
1515

1616
Or install it globally with
1717

1818
```bash
19-
npm i --location=global https://github.com/matteosacchetto/node-zip-cli/releases/download/v0.2.1/node-zip-cli-0.2.1.tgz
19+
npm i --location=global https://github.com/matteosacchetto/node-zip-cli/releases/download/v0.2.2/node-zip-cli-0.2.2.tgz
2020
```
2121

2222
### Other version
@@ -172,4 +172,4 @@ Simply run this CLI providing to each command all the necessary options.
172172

173173
This file is meant to be placed in a folder which you plan to zip. It is meant to be used instead of the .gitignore, if the content of the folder is not related to git, or as an extension of the .gitignore, where you can specify additional rules related only to the zip file creation. The .zipignore file follow the same syntax and rules of the traditional .gitignore
174174

175-
> **NOTE**: Up to the current version (0.2.0) the .zipignore builds on top of already existing .gitignore rules, so if you only want to ignore some additional files you **do not need** to copy paste the content of the .gitignore. Keep in mind that this behavior may change in the future
175+
> **NOTE**: Up to the current version (0.2.2) the .zipignore builds on top of already existing .gitignore rules, so if you only want to ignore some additional files you **do not need** to copy paste the content of the .gitignore. Keep in mind that this behavior may change in the future

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-zip-cli",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Simple NodeJS CLI which allows you to create a ZIP file with support for .gitignore files",
55
"main": "dist/app.mjs",
66
"bin": "dist/app.mjs",

src/commands/unzip.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,16 @@ unzipCommand.action(async (options) => {
9292
const content = await readFile(input);
9393
const archive = await zip.loadAsync(content);
9494

95-
const filenames = Object.keys(archive.files);
95+
const filenames = Object.keys(archive.files).filter(
96+
(el) => !el.endsWith('/')
97+
);
9698

99+
let i = 0;
97100
for (const filename of filenames) {
101+
spinner.text = `Extracting ${input} file to ${output} (${++i}/${
102+
filenames.length
103+
} files) ${chalk.dim(`[${filename}]`)}`;
104+
98105
const uncompressedFileContent = await archive
99106
.file(filename)
100107
?.async('uint8array');
@@ -109,7 +116,9 @@ unzipCommand.action(async (options) => {
109116
}
110117
}
111118

112-
spinner.succeed(`Extracted ${input} file to ${output}`);
119+
spinner.succeed(
120+
`Extracted ${input} file to ${output} (${filenames.length}/${filenames.length} files)`
121+
);
113122
} catch (e) {
114123
spinner.fail();
115124
if (e instanceof Error) console.error(e.message);

src/commands/zip.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ zipCommand.action(async (options) => {
160160
) {
161161
lastFile = metadata.currentFile;
162162
i++;
163-
spinner.text = `Creating ${output} file (${i}/${files.length} files)`;
163+
spinner.text = `Creating ${output} file (${i}/${
164+
files.length
165+
} files) ${chalk.dim(`[${metadata.currentFile}]`)}`;
164166
}
165167
}
166168
)

0 commit comments

Comments
 (0)