Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CLI output #7

Merged
merged 1 commit into from
May 15, 2016
Merged

Improve CLI output #7

merged 1 commit into from
May 15, 2016

Conversation

kevva
Copy link
Contributor

@kevva kevva commented May 15, 2016

Adds a spinner and some basic information. imagemin/imagemin#170 would make this even better.

Fixes imagemin/imagemin#158.

@sindresorhus sindresorhus merged commit efb9b39 into master May 15, 2016
@sindresorhus sindresorhus deleted the improve-cli branch May 15, 2016 16:58
@sindresorhus
Copy link
Contributor

Looks good :)

imagemin(input, opts.outDir, {use})
.then(files => {
if (!opts.outDir) {
files.forEach(x => process.stdout.write(x.data));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but this makes no sense. You can't output multiple images to stdout as there's no separator, so no tool would be able to handle it. I think we instead should throw an helpful error about this if outDir is not specified and the input is more than one file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a somewhat naive implementation expecting users that doesn't specify --out-dir only optimizing one file. I agree we should add an error for it since it won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants