Skip to content

Commit 543798c

Browse files
committed
Improvement for #17: Use config.json from work dir
1 parent 5343eab commit 543798c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.5.0
1+
v0.5.1

main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55
"fmt"
66
"os"
7+
"path"
78
"strings"
89

910
"github.com/virtualzone/onedrive-uploader/sdk"
@@ -35,7 +36,12 @@ func printHelp() {
3536
}
3637

3738
func prepareFlags() {
38-
flag.StringVar(&AppFlags.ConfigPath, "c", "./config.json", "path to config.json")
39+
configPath := "./config.json"
40+
wd, err := os.Getwd()
41+
if err == nil {
42+
configPath = path.Join(wd, "config.json")
43+
}
44+
flag.StringVar(&AppFlags.ConfigPath, "c", configPath, "path to config.json")
3945
flag.BoolVar(&AppFlags.Quiet, "q", false, "output errors only")
4046
flag.BoolVar(&AppFlags.Verbose, "v", false, "verbose output")
4147
flag.Parse()

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package main
22

3-
var AppVersion = "v0.5.0"
3+
var AppVersion = "v0.5.1"

0 commit comments

Comments
 (0)