Skip to content

Commit

Permalink
Merge pull request #91 from shssoichiro/90-Glob-Windows
Browse files Browse the repository at this point in the history
Fix parsing of glob paths on Windows
  • Loading branch information
shssoichiro authored Nov 7, 2017
2 parents fa334e0 + 9c7fdfd commit 47af54f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### Version 0.18.0 (unreleased)
- Bump `itertools` to 0.7
- Bump `image` to 0.17
- Bump minimum rustc version to 1.20.0
- [SEMVER_MAJOR] Bump minimum rustc version to 1.20.0
- Fix parsing of glob paths on Windows ([#90](https://github.com/shssoichiro/oxipng/issues/90))

### Version 0.17.2
- Bump `image` to 0.16
Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

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

34 changes: 25 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[package]
authors = ["Joshua Holmer <[email protected]>"]
categories = ["command-line-utilities", "compression"]
categories = [
"command-line-utilities",
"compression",
]
description = "A lossless PNG compression optimizer"
documentation = "https://docs.rs/oxipng"
exclude = ["tests/*", "bench/*"]
exclude = [
"tests/*",
"bench/*",
]
homepage = "https://github.com/shssoichiro/oxipng"
license = "MIT"
name = "oxipng"
repository = "https://github.com/shssoichiro/oxipng"
version = "0.17.2"

[lib]
name = "oxipng"
path = "src/lib.rs"

[[bin]]
doc = false
name = "oxipng"
Expand All @@ -23,6 +25,7 @@ path = "src/main.rs"
bit-vec = "^0.4.2"
byteorder = "^1.0.0"
crc = "^1.2.0"
glob = "0.2.11"
itertools = "^0.7.0"
libc = "^0.2.4"
miniz-sys = "^0.1.7"
Expand All @@ -48,11 +51,24 @@ optional = true
version = "^0.2.0"

[features]
binary = [
"clap",
"regex",
]
default = ["binary"]
binary = ["clap", "regex"]
dev = [
"nightly-binary",
"clippy",
]
nightly = []
nightly-binary = ["binary", "nightly", "regex/simd-accel"]
dev = ["nightly-binary", "clippy"]
nightly-binary = [
"binary",
"nightly",
"regex/simd-accel",
]

[lib]
name = "oxipng"
path = "src/lib.rs"
[profile.dev]
opt-level = 2
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
#![deny(missing_debug_implementations, missing_copy_implementations)]

extern crate clap;
extern crate glob;
extern crate oxipng;
extern crate regex;

use clap::{App, Arg, ArgMatches};
use glob::glob;
use oxipng::colors::AlphaOptim;
use oxipng::deflate::Deflaters;
use oxipng::headers::Headers;
Expand Down Expand Up @@ -235,7 +237,8 @@ fn main() {
matches
.values_of("files")
.unwrap()
.map(PathBuf::from)
.map(|pattern| glob(pattern).expect("Failed to parse input file path"))
.flat_map(|paths| paths.into_iter().map(|path| path.expect("Failed to parse input file path")))
.collect(),
&opts,
);
Expand Down

0 comments on commit 47af54f

Please sign in to comment.