Skip to content

Commit

Permalink
cmd: trailing slash in source path will not copy directory itself but…
Browse files Browse the repository at this point in the history
… all the files inside
  • Loading branch information
tdewolff committed Jul 31, 2023
1 parent de84f71 commit b59895a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/minify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 3 additions & 0 deletions cmd/minify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b59895a

Please sign in to comment.