Skip to content

Commit 4a78612

Browse files
committed
fix: output path
#1
1 parent 735ddd2 commit 4a78612

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

compressor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func main() {
190190

191191
func usage() {
192192
_, _ = fmt.Fprintf(os.Stderr,
193-
`Version: 2.5
193+
`Version: 2.6
194194
Usage: compressor [-h] [Options]
195195
196196
Options:

travel_work.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func travel() {
2121
}
2222
if !d.IsDir() {
2323
if ext := strings.ToLower(filepath.Ext(d.Name()))[1:]; config.IsAccept(ext) {
24-
newPath := filepath.Join(config.OutputPath, filepath.Base(path))
24+
newPath := filepath.Join(config.OutputPath, strings.TrimPrefix(path, config.InputPath))
2525
newPath = strings.TrimSuffix(newPath, filepath.Ext(newPath)) + platform.OutputFormat
2626
if err := os.MkdirAll(filepath.Dir(newPath), 0755); err != nil {
2727
logger.Println(color.RedString("Create New Path Failed"))

0 commit comments

Comments
 (0)