diff options
| -rwxr-xr-x | Build.sh | 18 | ||||
| -rw-r--r-- | config-example.yml | 7 | ||||
| -rw-r--r-- | config/config.go | 1 | ||||
| -rw-r--r-- | steam-export-cli.go | 10 |
4 files changed, 27 insertions, 9 deletions
@@ -7,16 +7,16 @@ fi go build -o bin/steam-export . -GOOS=windows -GOARCH="386" -go build -o bin/steam-export-$GOOS-$GOARCH . - -GOOS=windows -GOARCH=amd64 +export GOOS=windows +export GOARCH="386" go build -o bin/steam-export-$GOOS-$GOARCH.exe . -GOOS=linux -GOARCH=amd64 +export GOOS=windows +export GOARCH=amd64 go build -o bin/steam-export-$GOOS-$GOARCH.exe . -cp bin/steam-export-windows-amd64.exe /Fishtank/Mitch/SteamDrive/SteamGames/ +export GOOS=linux +export GOARCH=amd64 +go build -o bin/steam-export-$GOOS-$GOARCH . + +cp bin/* /Fishtank/Mitch/SteamDrive/scripts/ diff --git a/config-example.yml b/config-example.yml index 6f2837d..01e24e8 100644 --- a/config-example.yml +++ b/config-example.yml @@ -1,7 +1,14 @@ --- listen: 0.0.0.0:9413 +# Repositories that you want to expose on the web server SteamRepositories: # We're ideally looking for the full path to the steamapps folder # On windows you're going to escape the slashes - "C:\\Program Files (x86)\\Steam\\steamapps" # - "/usr/mitch/SteamGames/steamapps" +# optional + +# This defaults to: +# "C:\\Program Files (x86)\\Steam\\steamapps" +#if not set. This doesn't have to be listed in the repository list above +DefaultRepository: "/usr/mitch/SteamGames/steamapps" diff --git a/config/config.go b/config/config.go index 5debdb6..19a79c4 100644 --- a/config/config.go +++ b/config/config.go @@ -12,6 +12,7 @@ var ( type Config struct { SteamRepositories []string `yaml:"SteamRepositories"` + DefaultRepository string `yaml:"DefaultRepository"` Listen string } diff --git a/steam-export-cli.go b/steam-export-cli.go index 30afe83..5f5a0ca 100644 --- a/steam-export-cli.go +++ b/steam-export-cli.go @@ -6,6 +6,7 @@ import ( "fmt" "os" + "git.riedstra.us/mitch/steam-export/config" "git.riedstra.us/mitch/steam-export/steam" ) @@ -156,6 +157,15 @@ func deleteGame(args []string) error { } func main() { + config, err := config.LoadConfig() + if err != nil { + fmt.Println(err) + } else { + if config.DefaultRepository != "" { + defaultLib = config.DefaultRepository + } + } + if err := parseArgs(os.Args); err != nil { fmt.Fprintln(os.Stderr, err) printHelp() |
