Skip to content

Commit 1f9bf29

Browse files
committed
mobileBackup: fix out path error
1 parent 750fa8d commit 1f9bf29

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

go/src/sourcebox/file/mobile_backup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ func (m *MobileBackup) Run() error {
2626

2727
var typeStr []string
2828
if typeArg.Val == all {
29-
for _, val := range types {
30-
typeStr = append(typeStr, val)
29+
for k := range types {
30+
typeStr = append(typeStr, k)
3131
}
3232
} else {
3333
typeStr = strings.Split(typeArg.Val, ",")
@@ -43,7 +43,7 @@ func (m *MobileBackup) Run() error {
4343
return e
4444
}
4545

46-
e = m.config.Context.Write(path.Join(outDir, typeVal, "csv"), string(ret))
46+
e = m.config.Context.Write(path.Join(outDir, typeVal+".csv"), string(ret))
4747
if e != nil {
4848
return e
4949
}
@@ -68,7 +68,7 @@ func (m *MobileBackup) Init() {
6868
},
6969
"out": {
7070
Key: "out",
71-
Val: "./sms.csv",
71+
Val: "./",
7272
Desc: "backup file path",
7373
},
7474
},

go/src/sourcebox/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ func main() {
9191
var flags []cli.Flag
9292
for s, arg := range config.Args {
9393
gCfg, _ := GetGlobalCfgVal(k, arg.Key)
94-
arg.Val = gCfg
94+
if gCfg != "" {
95+
arg.Val = gCfg
96+
}
9597
flags = append(flags, &cli.StringFlag{
9698
Name: s,
97-
Usage: arg.Demo,
99+
Usage: arg.Desc + " " + arg.Demo,
98100
Value: arg.Val,
99101
Required: arg.Required,
100102
})

0 commit comments

Comments
 (0)