working commit
This commit is contained in:
+19
-19
@@ -338,18 +338,18 @@ func (util *FileUtil) listFiles(common *CommonFileParams, params *ListFilesParam
|
||||
if params.AsRegexp {
|
||||
params.AsPrefix = false
|
||||
}
|
||||
var pathAs term.PathUsage
|
||||
var pathUsage string
|
||||
switch {
|
||||
case params.AsRegexp:
|
||||
pathAs = term.AsRegexp
|
||||
pathUsage = term.AsRegexp
|
||||
case params.AsPrefix:
|
||||
pathAs = term.AsPrefix
|
||||
pathUsage = term.AsPrefix
|
||||
default:
|
||||
pathAs = term.AsFinePath
|
||||
pathUsage = term.AsFinePath
|
||||
}
|
||||
timeout := time.Duration(common.Timeout) * time.Second
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathAs)
|
||||
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathUsage)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
@@ -464,18 +464,18 @@ func (util *FileUtil) exportFiles(common *CommonFileParams, params *ExportFilesP
|
||||
if params.AsRegexp {
|
||||
params.AsPrefix = false
|
||||
}
|
||||
var pathAs term.PathUsage
|
||||
var pathUsage string
|
||||
switch {
|
||||
case params.AsRegexp:
|
||||
pathAs = term.AsRegexp
|
||||
pathUsage = term.AsRegexp
|
||||
case params.AsPrefix:
|
||||
pathAs = term.AsPrefix
|
||||
pathUsage = term.AsPrefix
|
||||
default:
|
||||
pathAs = term.AsFinePath
|
||||
pathUsage = term.AsFinePath
|
||||
}
|
||||
timeout := time.Duration(common.Timeout) * time.Second
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathAs)
|
||||
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathUsage)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
@@ -553,18 +553,18 @@ func (util *FileUtil) listCollections(common *CommonFileParams, params *ListColl
|
||||
if params.AsRegexp {
|
||||
params.AsPrefix = false
|
||||
}
|
||||
var pathAs term.PathUsage
|
||||
var pathUsage string
|
||||
switch {
|
||||
case params.AsRegexp:
|
||||
pathAs = term.AsRegexp
|
||||
pathUsage = term.AsRegexp
|
||||
case params.AsPrefix:
|
||||
pathAs = term.AsPrefix
|
||||
pathUsage = term.AsPrefix
|
||||
default:
|
||||
pathAs = term.AsFinePath
|
||||
pathUsage = term.AsFinePath
|
||||
}
|
||||
timeout := time.Duration(common.Timeout) * time.Second
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
collecions, err := client.NewClient().ListCollections(ctx, params.Path, pathAs)
|
||||
collecions, err := client.NewClient().ListCollections(ctx, params.Path, pathUsage)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
@@ -603,14 +603,14 @@ func (util *FileUtil) deleteCollection(common *CommonFileParams, params *DeleteC
|
||||
}
|
||||
timeout := time.Duration(common.Timeout) * time.Second
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
var pathAs term.PathUsage
|
||||
var pathUsage string
|
||||
switch {
|
||||
case params.AsPrefix:
|
||||
pathAs = term.AsPrefix
|
||||
pathUsage = term.AsPrefix
|
||||
default:
|
||||
pathAs = term.AsFinePath
|
||||
pathUsage = term.AsFinePath
|
||||
}
|
||||
files, err := client.NewClient().DeleteCollection(ctx, params.Path, pathAs, params.DryRun)
|
||||
files, err := client.NewClient().DeleteCollection(ctx, params.Path, pathUsage, params.DryRun)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user