diff --git a/cmd/minify/README.md b/cmd/minify/README.md index 2a5247aa9b..b14f6a16bf 100644 --- a/cmd/minify/README.md +++ b/cmd/minify/README.md @@ -172,6 +172,8 @@ Minify only javascript files in **src/**: $ minify -r -o out/ --match="\.js$" src ``` +A trailing slash in the source path will copy all files inside the directory, while omitting the trainling slash will copy the directory as well. + ### Concatenate When multiple inputs are given and the output is either standard output or a single file, it will concatenate the files together if you use the bundle option. diff --git a/cmd/minify/main.go b/cmd/minify/main.go index a7a9866b7c..cec53aafa1 100644 --- a/cmd/minify/main.go +++ b/cmd/minify/main.go @@ -346,6 +346,9 @@ func run() int { for i, input := range inputs { inputs[i] = filepath.Clean(input) + if input[len(input)-1] == '/' { + inputs[i] += "/" + } } // set output file or directory, empty means stdout