error handling, release builds
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.idea
|
||||
epoch-linux
|
||||
epoch-linux.tar.gz
|
||||
bin/
|
||||
epochcli-*
|
||||
*.tar.gz
|
||||
|
15
README.md
15
README.md
@ -1,23 +1,22 @@
|
||||
# epoch-linux
|
||||
# epochcli
|
||||
|
||||
Linux updater and launcher for [Project Epoch](https://www.project-epoch.net/) Still a work in progress.
|
||||
CLI tool for updating and launching [Project Epoch](https://www.project-epoch.net/) on Linux & macOS.
|
||||
|
||||
## TODO
|
||||
|
||||
- better error handling
|
||||
- improve config generation
|
||||
- add ability to launch Epoch after an update
|
||||
|
||||
- Properly test on macOS
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Set up a copy of WoW 3.3.5 in a wine prefix or launcher of your choice. Chromiecraft has a good torrent you can use for the 3.3.5 client
|
||||
2. Install `epoch-linux` by either
|
||||
2. Install `epochcli` by either
|
||||
1. Download the latest binary from the [releases](https://git.burkey.co/eburk/epoch-linux/releases) page
|
||||
2. If you have the `go` toolchain installed, you can run `go install git.burkey.co/eburk/epoch-linux` to install to your `$GOROOT`
|
||||
2. If you have the `go` toolchain installed, you can run `go install git.burkey.co/eburk/epochcli` to install to your `$GOROOT`
|
||||
3. Compile the source yourself
|
||||
3. Run `epoch-linux` once. This will create a config file at `$HOME/.config/epoch-linux/config.toml`. Change the `WowDir` variable to your Wow game directory
|
||||
4. Run `epoch-linux` again. It will download the patch files from Epoch's servers to your Wow directory
|
||||
3. Run `epochcli` once. This will create a config file at `$HOME/.config/epoch-linux/config.toml`. Change the `WowDir` variable to your Wow game directory
|
||||
4. Run `epochcli` again. It will download the patch files from Epoch's servers to your Wow directory
|
||||
5. Use your launcher or tool of choice to startup Epoch in `wine`
|
||||
|
||||
## Issues
|
||||
|
24
main.go
24
main.go
@ -15,6 +15,7 @@ import (
|
||||
|
||||
const (
|
||||
manifestUrl = "https://updater.project-epoch.net/api/manifest"
|
||||
defaultWowPath = "/path/to/wow"
|
||||
configDirName = "epoch-linux"
|
||||
configName = "config.toml"
|
||||
)
|
||||
@ -27,10 +28,10 @@ var (
|
||||
config Config
|
||||
)
|
||||
|
||||
func setupConfig() {
|
||||
func setupConfig() error {
|
||||
home := os.Getenv("HOME")
|
||||
if home == "" {
|
||||
log.Fatal("$HOME environment variable not set")
|
||||
return fmt.Errorf("$HOME environment variable not set")
|
||||
}
|
||||
|
||||
cfgPath := filepath.Join(home, ".config", configDirName, configName)
|
||||
@ -39,18 +40,18 @@ func setupConfig() {
|
||||
os.MkdirAll(filepath.Join(home, ".config", configDirName), 0755)
|
||||
|
||||
newConfig := &Config{
|
||||
WowDir: "/path/to/wow",
|
||||
WowDir: defaultWowPath,
|
||||
}
|
||||
|
||||
file, err := os.Create(cfgPath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
encoder := toml.NewEncoder(file)
|
||||
if err = encoder.Encode(newConfig); err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Created new config at %s, edit it before running the launcher again\n", cfgPath)
|
||||
@ -59,12 +60,21 @@ func setupConfig() {
|
||||
|
||||
_, err := toml.DecodeFile(cfgPath, &config)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
|
||||
if config.WowDir == defaultWowPath {
|
||||
return fmt.Errorf("WowDir in %s is still the default setting", cfgPath)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
setupConfig()
|
||||
err := setupConfig()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
count, err := downloadUpdate()
|
||||
if err != nil {
|
||||
|
19
release.sh
19
release.sh
@ -2,5 +2,20 @@
|
||||
|
||||
set -e
|
||||
|
||||
GOOS=linux GOARCH=amd64 go build
|
||||
tar czvf epoch-linux.tar.gz ./epoch-linux
|
||||
rm ./*.tar.gz
|
||||
|
||||
mkdir bin
|
||||
|
||||
GOOS=linux GOARCH=amd64 go build -o bin/epochcli-linux-amd64
|
||||
tar czvf epochcli-linux-amd64.tar.gz bin/epochcli-linux-amd64
|
||||
|
||||
GOOS=linux GOARCH=arm64 go build -o bin/epochcli-linux-arm64
|
||||
tar czvf epochcli-linux-arm64.tar.gz bin/epochcli-linux-arm64
|
||||
|
||||
GOOS=darwin GOARCH=amd64 go build -o bin/epochcli-darwin-amd64
|
||||
tar czvf epochcli-darwin-amd64.tar.gz bin/epochcli-darwin-amd64
|
||||
|
||||
GOOS=darwin GOARCH=arm64 go build -o bin/epochcli-darwin-arm64
|
||||
tar czvf epochcli-darwin-arm64.tar.gz bin/epochcli-darwin-arm64
|
||||
|
||||
rm -rf bin
|
Reference in New Issue
Block a user