Skip to content

Commit

Permalink
Chore(package): prepare 3.0.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Jul 17, 2017
1 parent e9d6ac3 commit 8d26ce7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

# 2.0.1 - 2017-07-17
# 3.0.0 - 2017-07-17

- Chore(package): minimum required `fs-extra` version is now `^4.0.0`.
- Changed: `cwd` argument used for search only. It is revert changes introduced in version 2.

# 2.0.0 - 2017-06-23

Expand Down
2 changes: 1 addition & 1 deletion __tests__/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ test("optimize a PNG use glob pattern and `recursive` argument", async t => {
test("optimize a PNG use glob pattern, `cwd` and `recursive` argument", async t => {
await execa(cliPath, [
"image/folder/test.png",
"--out-dir=../tmp",
"--out-dir=fixtures/tmp",
"--plugin=pngquant",
"--cwd=fixtures/deep",
"--recursive"
Expand Down
20 changes: 11 additions & 9 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ const cli = meow(
Options:
-c, --config Configuration for plugins, need export \`plugins\`.
-d, --cwd Current working directory.
-d, --cwd The current working directory in which to search. Defaults to process.cwd().
-m, --max-concurrency Sets the maximum number of instances of Imagemin that can run at once.
-p, --plugin Override the default plugins.
-o, --out-dir Output directory (respect \`cwd\` argument).
-o, --out-dir Output directory.
-r, --recursive Run the command recursively.
-i, --ignore-errors Not stop on errors (it works with only with <path|glob>).
-s --silent Reported only errors.
Expand Down Expand Up @@ -89,11 +89,13 @@ const handleFile = (filepath, opts) =>
}

const outDir = !path.isAbsolute(opts.outDir)
? path.join(opts.cwd, opts.outDir)
? path.join(process.cwd(), opts.outDir)
: path.normalize(opts.outDir);

const dest = path.resolve(
path.join(outDir, parentDirectory, path.basename(filepath))
const dest = path.join(
outDir,
parentDirectory,
path.basename(filepath)
);

const ret = {
Expand Down Expand Up @@ -314,14 +316,14 @@ const run = (input, options) => {

const optionsBase = {};

if (cli.flags.config) {
optionsBase.config = cli.flags.config;
}

if (cli.flags.cwd) {
optionsBase.cwd = cli.flags.cwd;
}

if (cli.flags.config) {
optionsBase.config = cli.flags.config;
}

if (cli.flags.maxConcurrency) {
optionsBase.maxConcurrency = cli.flags.maxConcurrency;
}
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imagemin-power-cli",
"version": "2.0.1",
"version": "3.0.0",
"description": "Optimize (compress) images with power using imagemin",
"keywords": [
"cli",
Expand Down

0 comments on commit 8d26ce7

Please sign in to comment.