aboutsummaryrefslogtreecommitdiff
path: root/steam-export-cli.go
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2017-01-16 16:20:43 -0500
committerMitch Riedstra <mitch@riedstra.us>2017-01-16 16:20:43 -0500
commit147880a848dd31a3265ffc60a16eccd4ee9d6713 (patch)
treea0b82126a4004805b8b95f5118656f9ddc2b4d25 /steam-export-cli.go
parent719ab6c074c1104a2a8e165486dbbd236ca49e11 (diff)
downloadsteam-export-147880a848dd31a3265ffc60a16eccd4ee9d6713.tar.gz
steam-export-147880a848dd31a3265ffc60a16eccd4ee9d6713.tar.xz
Change default path depending on platform
Diffstat (limited to 'steam-export-cli.go')
-rw-r--r--steam-export-cli.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/steam-export-cli.go b/steam-export-cli.go
index 5f5a0ca..e738fa9 100644
--- a/steam-export-cli.go
+++ b/steam-export-cli.go
@@ -13,8 +13,7 @@ import (
var (
errorHandling flag.ErrorHandling = flag.ExitOnError
- defaultLib string = `C:\Program Files (x86)\Steam\steamapps`
- steamLib *steam.Library = &steam.Library{}
+ steamLib *steam.Library = &steam.Library{}
)
func parseArgs(args []string) error {
@@ -54,10 +53,10 @@ Subcommands:
func listGames(args []string) error {
fl := flag.NewFlagSet("list", errorHandling)
- lib := fl.String("l", defaultLib,
+ lib := fl.String("l", steam.DefaultLib,
"Path to library in question. All the way to the 'steamapps' folder")
- l := defaultLib
+ l := steam.DefaultLib
fl.Parse(args)
if fl.Parsed() {
l = string(*lib)
@@ -74,7 +73,7 @@ func listGames(args []string) error {
func packageGame(args []string) error {
fl := flag.NewFlagSet("package", errorHandling)
- lib := fl.String("l", defaultLib,
+ lib := fl.String("l", steam.DefaultLib,
"Path to library in question. All the way to the 'steamapps' folder")
fileName := fl.String("f", "export",
"Name of the archive file to be created. Please do not include the file extension")
@@ -82,7 +81,7 @@ func packageGame(args []string) error {
"Index of the game to be exported. Please see `list` for the index")
var g int
- l := defaultLib
+ l := steam.DefaultLib
fl.Parse(args)
if fl.Parsed() {
l = string(*lib)
@@ -107,12 +106,12 @@ func packageGame(args []string) error {
func extractGame(args []string) error {
fl := flag.NewFlagSet("extract", errorHandling)
- lib := fl.String("l", defaultLib,
+ lib := fl.String("l", steam.DefaultLib,
"Path to library in question. All the way to the 'steamapps' folder")
fileName := fl.String("f", "",
"Name of the archive file to be extracted. Please include the file extension")
- l := defaultLib
+ l := steam.DefaultLib
fl.Parse(args)
if fl.Parsed() {
l = string(*lib)
@@ -132,13 +131,13 @@ func extractGame(args []string) error {
func deleteGame(args []string) error {
fl := flag.NewFlagSet("delete", errorHandling)
- lib := fl.String("l", defaultLib,
+ lib := fl.String("l", steam.DefaultLib,
"Path to library in question. All the way to the 'steamapps' folder")
game := fl.Int("g", -1,
"Index of the game to be deleted. Please see `list` for the index")
var g int
- l := defaultLib
+ l := steam.DefaultLib
fl.Parse(args)
if fl.Parsed() {
l = string(*lib)
@@ -162,7 +161,7 @@ func main() {
fmt.Println(err)
} else {
if config.DefaultRepository != "" {
- defaultLib = config.DefaultRepository
+ steam.DefaultLib = config.DefaultRepository
}
}