Skip to content

Commit

Permalink
Fix service arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
cubewise-tryan committed Oct 16, 2019
1 parent 7aaed0b commit 8f09cd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"mode": "auto",
"program": "${fileDirname}",
"env": {},
"args": ["-addr", ":8888", "-http-only", "-tls-skip-verify"]
"args": ["-addr", ":8888", "-http-only", "-tls-skip-verify", "-cache-dir", "C:\\Temp\\"]
}
]
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cubewise-tryan/leproxy
module github.com/cubewise-code/sweetssl

require (
github.com/artyom/autoflags v1.1.0
Expand Down
14 changes: 9 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,20 @@ func main() {

autoflags.Parse(&args)

if strings.HasSuffix(args.CacheDir, "\\") {
args.CacheDir = args.CacheDir[:len(args.CacheDir)-1]
}

// Add the arguments to Windows services
serviceArgs := []string{
"-addr",
fmt.Sprintf("\"%s\"", args.Addr),
args.Addr,
"-http",
fmt.Sprintf("\"%s\"", args.HTTP),
"-conf",
fmt.Sprintf("\"%s\"", args.MappingPath),
args.HTTP,
"-mapping",
args.MappingPath,
"-cache-dir",
fmt.Sprintf("\"%s\"", args.CacheDir),
args.CacheDir,
}
if args.HTTPOnly {
serviceArgs = append(serviceArgs, "-http-only")
Expand Down

0 comments on commit 8f09cd3

Please sign in to comment.