File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,12 @@ func NewUploadCommand() cli.Command {
370
370
if c .Int ("w" ) > 10 || c .Int ("w" ) < 1 {
371
371
PrintErrorAndExit ("max concurrent threads must between (1 - 10)" )
372
372
}
373
+ filenames := c .Args ()
374
+ if isWindowsGOOS () {
375
+ filenames = globFiles (filenames )
376
+ }
373
377
session .Upload (
374
- c . Args () ,
378
+ filenames ,
375
379
c .String ("remote" ),
376
380
c .Int ("w" ),
377
381
c .Bool ("all" ),
Original file line number Diff line number Diff line change 5
5
"fmt"
6
6
"io"
7
7
"os"
8
+ "path/filepath"
9
+ "runtime"
8
10
"strconv"
9
11
"strings"
10
12
"time"
@@ -140,3 +142,20 @@ func contains(slice []string, item string) bool {
140
142
}
141
143
return false
142
144
}
145
+
146
+ func globFiles (patterns []string ) []string {
147
+ filenames := make ([]string , 0 )
148
+ for _ , filename := range patterns {
149
+ if strings .Contains (filename , "*" ) {
150
+ matches , err := filepath .Glob (filename )
151
+ if err == nil {
152
+ filenames = append (filenames , matches ... )
153
+ }
154
+ }
155
+ }
156
+ return filenames
157
+ }
158
+
159
+ func isWindowsGOOS () bool {
160
+ return runtime .GOOS == "windows"
161
+ }
You can’t perform that action at this time.
0 commit comments