💾
This commit is contained in:
parent
fca4b4db6b
commit
bd6d2e5b8e
16
README.md
16
README.md
@ -6,7 +6,7 @@ Accesses the [Gogs Client API](https://github.com/gogits/go-gogs-client), which
|
|||||||
|
|
||||||
## Setup.
|
## Setup.
|
||||||
|
|
||||||
_TLDR:_ Just make sure the `gogs` executable winds up somewhere in your `$PATH`.
|
_TLDR:_ Just make sure the `gogs` executable winds up somewhere in your `$PATH`. Set your `GOGS_URL` and `GOGS_TOKEN` vars somehow.
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
Clone the repo and build and install it yourself, or `go get github.com/irstacks/go-gogs-cli`.
|
Clone the repo and build and install it yourself, or `go get github.com/irstacks/go-gogs-cli`.
|
||||||
@ -46,6 +46,12 @@ Now here you've got some options (probably) about in which of your $PATH's paths
|
|||||||
```bash
|
```bash
|
||||||
$ cp gogs ~/bin/
|
$ cp gogs ~/bin/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
... Or let Go decide where to put the executable for you. Just make sure your `$GOPATH/bin` is actually in your `$PATH`.
|
||||||
|
```bash
|
||||||
|
# This builds and moves the executable to $GOPATH/bin.
|
||||||
|
$ go install # From inside the base of the project.
|
||||||
|
```
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
#### This repo's build is for darwin (Mac).
|
#### This repo's build is for darwin (Mac).
|
||||||
@ -54,16 +60,12 @@ If you're on a Mac and want to build it for your server or something, you can bu
|
|||||||
## Config.
|
## Config.
|
||||||
Once you've got the project, you'll need to configure your own `GOGS_TOKEN` and `GOGS_URL` variables.
|
Once you've got the project, you'll need to configure your own `GOGS_TOKEN` and `GOGS_URL` variables.
|
||||||
<br>
|
<br>
|
||||||
You can use
|
You can use a file called `.go-gogs-cli.yaml` that likes to live at `$HOME/.go-gogs-cli.yaml`. It handles configuring your __Gogs url__ and __token__, like such:
|
||||||
```bash
|
|
||||||
$ go install # From inside the base of the project.
|
|
||||||
```
|
|
||||||
which'll create a file called `.go-gogs-cli.yaml` that likes to live at `$HOME/.go-gogs-cli.yaml`. It handles configuring your __Gogs url__ and __token__, like such:
|
|
||||||
```yaml
|
```yaml
|
||||||
GOGS_TOKEN: 0e6709o05da4753dddf5f592374fdc263f02n801
|
GOGS_TOKEN: 0e6709o05da4753dddf5f592374fdc263f02n801
|
||||||
GOGS_URL: http://my.goggers.me
|
GOGS_URL: http://my.goggers.me
|
||||||
```
|
```
|
||||||
Fill that in for your own self.
|
Make that file (there's an example in the repo) and fill that in for your own self.
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
__Or__, if you'd rather use environment variables, that'll work fine too.
|
__Or__, if you'd rather use environment variables, that'll work fine too.
|
||||||
|
@ -104,7 +104,7 @@ func initConfig() {
|
|||||||
if err := viper.ReadInConfig(); err == nil {
|
if err := viper.ReadInConfig(); err == nil {
|
||||||
// fmt.Println("Using config file:", viper.ConfigFileUsed())
|
// fmt.Println("Using config file:", viper.ConfigFileUsed())
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("No configuration file found. Is there for sure one at " + viper.ConfigFileUsed() + "?")
|
fmt.Println("No configuration file found. Is there for sure one at $HOME/.go-gogs-cli.yaml?")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user