Skip to content

Commit

Permalink
Improvement for #17: Use config.json from work dir
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualzone committed Oct 3, 2022
1 parent 5343eab commit 543798c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.5.0
v0.5.1
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"os"
"path"
"strings"

"github.com/virtualzone/onedrive-uploader/sdk"
Expand Down Expand Up @@ -35,7 +36,12 @@ func printHelp() {
}

func prepareFlags() {
flag.StringVar(&AppFlags.ConfigPath, "c", "./config.json", "path to config.json")
configPath := "./config.json"
wd, err := os.Getwd()
if err == nil {
configPath = path.Join(wd, "config.json")
}
flag.StringVar(&AppFlags.ConfigPath, "c", configPath, "path to config.json")
flag.BoolVar(&AppFlags.Quiet, "q", false, "output errors only")
flag.BoolVar(&AppFlags.Verbose, "v", false, "verbose output")
flag.Parse()
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

var AppVersion = "v0.5.0"
var AppVersion = "v0.5.1"

0 comments on commit 543798c

Please sign in to comment.