Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
dyoung522 committed Aug 20, 2024
1 parent e03246e commit 75e90c6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOARCH: amd64
GOOS: darwin
EXTRA_FILES: "LICENSE"
EXTRA_FILES: "LICENSE README.md"
release-windows-amd64:
name: release windows/amd64
runs-on: ubuntu-latest
Expand All @@ -24,4 +24,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOARCH: amd64
GOOS: windows
EXTRA_FILES: "LICENSE"
EXTRA_FILES: "LICENSE README.md"
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ESO Tools

(c)2024 Donovan C. Young

This software is published under the terms of the MIT Software License

ESO Tools is a command line tool designed to help manage ESO AddOns

## Installation

Installation instructions are coming Soon...

## Configuration

Before you can use the tool, it needs to know the location where your Local ESO game configuration files are installed.
This is usually in `%AppData%\Elder Scrolls Online` on Windows or `${HOME}/Documents/Elder Scrolls Online` on MacOS.

### Configuration File

The best way to do this is to create an `.esotools.yaml` file in your HOME directory with the following contents:

```yaml
eso_home: "/<your-home-directory>/Documents/Elder Scrolls Online"
```
The advantage to creating an `.esotools.yaml` file is that you only need to do this once, and then can simply run `esotools` without supplying any additional information.

### Other Configuration Options

Optionally, you can also use the command line option `--esohome` (or `-H` for short), or set an `ESO_HOME` environment variable. However, please note that using either of these options will override anything in your `.esotools.yaml` file (if it exists).

#### command-line option

```sh
esotools -H "${HOME}/Documents/Elder Scrolls Online"
```

#### environment variable

```sh
ESO_HOME="${HOME}/Documents/Game Files/Elder Scrolls Online" esotools
```
10 changes: 2 additions & 8 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Copyright © 2024 Donovan C. Young <dyoung522@gmail.com>
package cmd

import (
"fmt"
"os"

sub1 "github.com/dyoung522/esotools/cmd/list"
Expand All @@ -18,7 +17,7 @@ var cfgFile string
var RootCmd = &cobra.Command{
Use: "esotools",
Version: "0.1.0",
Short: "toosl used to list, install, and validate ESO mods",
Short: "tools used to list, install, and validate ESO mods",
}

// Execute adds all child commands to the root command and sets flags appropriately.
Expand Down Expand Up @@ -75,10 +74,5 @@ func initConfig() {
viper.AutomaticEnv() // read in environment variables that match

// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
if viper.GetBool("verbose") {
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
}
}

viper.ReadInConfig()
}
7 changes: 3 additions & 4 deletions pkg/modTools/mod_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ var AddOnsPath string

func Run() (esoMods.Mods, []error) {
ESOHOME = string(viper.GetString("eso_home"))

if ESOHOME == "" {
fmt.Println(errors.New("please set the ESO_HOME environment variable and try again"))
os.Exit(1)
}

AddOnsPath = filepath.Join(filepath.Clean(string(ESOHOME)), "live", "AddOns")

verbose := viper.GetBool("verbose")

if verbose {
fmt.Printf("Getting list of mods\n\n")
if viper.GetBool("verbose") {
fmt.Printf("Searching for mods mods in %q\n\n", AddOnsPath)
}

return GetMods()
Expand Down

0 comments on commit 75e90c6

Please sign in to comment.