Skip to content

Commit e313efd

Browse files
budak7273surdaft
andauthored
feat: compatibility info display in View Mod screen. log to ficsit-cli.log by default (#33)
* fix: log by default (ficsit-cli.log in CWD) * chore: update readme with info on code generation * chore: regenerate docs for default log file location * feat: compatibility info state and note display. wip: keybind to switch view modes not working * fix: move render code out to a function, but it still isn't quite working yet * feat: display mod reference below mod name * Fix compat toggle with * Show scroll up/down on quick help * chore: fix merge conflict * chore: run go install mvdan.cc/gofumpt@latest; gofumpt -l -w . * chore: run gci.exe write --skip-generated -s standard -s default -s 'prefix(github.com/satisfactorymodding/ficsit-cli)' -s blank -s dot . * chore: update readme linting info and run golangci-lint --version * fix: log file is defaulted to empty again * fix(#33): update render to return just string * fix(#33): renderModInfo returns only string * fix(#33): reollback func namechange * refactor(#33): remove redundant viewport refresh * refactor(#33): update is not required after setting content * refactor(#33): remove unrequired log * docs(#33): update documentation to latest generated * docs(#33): update cache reference to not contain username * docs(#33): fix local dir references too * refactor(#33): replace vague variable with more helpful * Add directions about using dev schema when generate command fails * Fix issues from earlier merge conflict --------- Co-authored-by: Jack Stupple <[email protected]>
1 parent 0b2bc27 commit e313efd

26 files changed

+530
-249
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,42 @@ Run `ficsit help` to see a list of available commands.
9090
* [Go 1.21](https://go.dev/doc/install)
9191
* IDE of Choice. Goland or VSCode suggested.
9292

93+
### Code Generation
94+
95+
If you update any of the GraphQL queries, run this to update generated code:
96+
97+
```bash
98+
(echo "y") | npx graphqurl https://api.ficsit.app/v2/query --introspect -H 'content-type: application/json' > schema.graphql
99+
go generate -tags tools -x ./...
100+
```
101+
102+
If this command fails due to a mismatched schema,
103+
you may need to use the url `https://api.ficsit.dev/v2/query` instead.
104+
93105
## Building
94106

95107
```bash
96108
go build
97109
```
98110

99111
Will produce `ficsit-cli.exe` in the repo root directory.
112+
113+
### Linting
114+
115+
Install `golangci-lint` via the directions [here](https://golangci-lint.run/usage/install/#local-installation),
116+
but make sure to install the version specified in `.github/workflows/push.yaml` instead of whatever it suggests.
117+
118+
Then, to run it, use:
119+
120+
```bash
121+
golangci-lint run --fix
122+
```
123+
124+
### Updating generated docs
125+
126+
The files within `./docs` are generated using cobra, use the following to update
127+
them.
128+
129+
```bash
130+
go run tools.go
131+
```

cli/disk/local.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ func (l localDisk) Read(path string) ([]byte, error) {
4040
}
4141

4242
func (l localDisk) Write(path string, data []byte) error {
43-
return os.WriteFile(path, data, 0777) //nolint
43+
return os.WriteFile(path, data, 0o777) //nolint
4444
}
4545

4646
func (l localDisk) Remove(path string) error {
4747
return os.RemoveAll(path) //nolint
4848
}
4949

5050
func (l localDisk) MkDir(path string) error {
51-
return os.MkdirAll(path, 0777) //nolint
51+
return os.MkdirAll(path, 0o777) //nolint
5252
}
5353

5454
func (l localDisk) ReadDir(path string) ([]Entry, error) {
@@ -68,5 +68,5 @@ func (l localDisk) ReadDir(path string) ([]Entry, error) {
6868
}
6969

7070
func (l localDisk) Open(path string, flag int) (io.WriteCloser, error) {
71-
return os.OpenFile(path, flag, 0777) //nolint
71+
return os.OpenFile(path, flag, 0o777) //nolint
7272
}

cspell.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
// words - list of words to be always considered correct
88
"words": [
99
"ficsit",
10+
"gofumpt",
1011
"Goland",
12+
"golangci",
13+
"goquery",
14+
"graphqurl",
15+
"mvdan",
16+
"pgdn",
17+
"pgup",
1118
"wordwrap"
1219
],
1320
// flagWords - list of words to be always considered incorrect

docs/ficsit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ cli mod manager for satisfactory
77
```
88
--api-base string URL for API (default "https://api.ficsit.app")
99
--api-key string API key to use when sending requests
10-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
10+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
1111
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
1212
--dry-run Dry-run. Do not save any changes
1313
--graphql-api string Path for GraphQL API (default "/v2/query")
1414
-h, --help help for ficsit
1515
--installations-file string The installations file (default "installations.json")
16-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
16+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
1717
--log string The log level to output (default "info")
1818
--log-file string File to output logs to
1919
--offline Whether to only use local data

docs/ficsit_apply.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ficsit apply [installation] ... [flags]
1717
```
1818
--api-base string URL for API (default "https://api.ficsit.app")
1919
--api-key string API key to use when sending requests
20-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
20+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
2121
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
2222
--dry-run Dry-run. Do not save any changes
2323
--graphql-api string Path for GraphQL API (default "/v2/query")
2424
--installations-file string The installations file (default "installations.json")
25-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
25+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
2626
--log string The log level to output (default "info")
2727
--log-file string File to output logs to
2828
--offline Whether to only use local data

docs/ficsit_cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ficsit cli [flags]
1717
```
1818
--api-base string URL for API (default "https://api.ficsit.app")
1919
--api-key string API key to use when sending requests
20-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
20+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
2121
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
2222
--dry-run Dry-run. Do not save any changes
2323
--graphql-api string Path for GraphQL API (default "/v2/query")
2424
--installations-file string The installations file (default "installations.json")
25-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
25+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
2626
--log string The log level to output (default "info")
2727
--log-file string File to output logs to
2828
--offline Whether to only use local data

docs/ficsit_installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Manage installations
1313
```
1414
--api-base string URL for API (default "https://api.ficsit.app")
1515
--api-key string API key to use when sending requests
16-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
16+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
1717
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
1818
--dry-run Dry-run. Do not save any changes
1919
--graphql-api string Path for GraphQL API (default "/v2/query")
2020
--installations-file string The installations file (default "installations.json")
21-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
21+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
2222
--log string The log level to output (default "info")
2323
--log-file string File to output logs to
2424
--offline Whether to only use local data

docs/ficsit_installation_add.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ficsit installation add <path> [profile] [flags]
1717
```
1818
--api-base string URL for API (default "https://api.ficsit.app")
1919
--api-key string API key to use when sending requests
20-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
20+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
2121
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
2222
--dry-run Dry-run. Do not save any changes
2323
--graphql-api string Path for GraphQL API (default "/v2/query")
2424
--installations-file string The installations file (default "installations.json")
25-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
25+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
2626
--log string The log level to output (default "info")
2727
--log-file string File to output logs to
2828
--offline Whether to only use local data

docs/ficsit_installation_ls.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ficsit installation ls [flags]
1717
```
1818
--api-base string URL for API (default "https://api.ficsit.app")
1919
--api-key string API key to use when sending requests
20-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
20+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
2121
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
2222
--dry-run Dry-run. Do not save any changes
2323
--graphql-api string Path for GraphQL API (default "/v2/query")
2424
--installations-file string The installations file (default "installations.json")
25-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
25+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
2626
--log string The log level to output (default "info")
2727
--log-file string File to output logs to
2828
--offline Whether to only use local data

docs/ficsit_installation_remove.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ficsit installation remove <path> [flags]
1717
```
1818
--api-base string URL for API (default "https://api.ficsit.app")
1919
--api-key string API key to use when sending requests
20-
--cache-dir string The cache directory (default "/home/vilsol/.cache/ficsit")
20+
--cache-dir string The cache directory (default "/home/{{Username}}/.cache/ficsit")
2121
--concurrent-downloads int Maximum number of concurrent downloads (default 5)
2222
--dry-run Dry-run. Do not save any changes
2323
--graphql-api string Path for GraphQL API (default "/v2/query")
2424
--installations-file string The installations file (default "installations.json")
25-
--local-dir string The local directory (default "/home/vilsol/.local/share/ficsit")
25+
--local-dir string The local directory (default "/home/{{Username}}/.local/share/ficsit")
2626
--log string The log level to output (default "info")
2727
--log-file string File to output logs to
2828
--offline Whether to only use local data

0 commit comments

Comments
 (0)