Skip to content

Commit

Permalink
fix: Update go to 1.22, change config file to xdg_data_dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
GSMLG-BOT committed Apr 18, 2024
1 parent ad28467 commit 8eb60cf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea/
.semrel/
/gsmlg-golang
/gsmlg-cli
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.PHONY: setup-dev setup-ci
.PHONY: setup-dev setup-ci build
.EXPORT_ALL_VARIABLES:

CGO_ENABLE := 0
GOOS := ${GOOS}
GOARCH := ${GOARCH}

setup-dev:
@go mod edit -replace github.com/gsmlg-dev/gsmlg-golang=../gsmlg-golang
Expand All @@ -9,6 +13,9 @@ setup-ci:
@go mod edit -replace github.com/gsmlg-dev/gsmlg-golang=./gsmlg-golang

build:
@go build -o gsmlg-cli main.go

@echo GO Build: $$GOOS $$GOARCH $$CGO_ENABLE
@go build -trimpath -o gsmlg-cli main.go

clean:
@rm -rf gsmlg-golang
@rm -rf gsmlg-cli
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# GSMLG CLI

A command line tool for my private affair.

```bash
```shell
A command line tool for my private affair.

Usage:
Expand All @@ -13,12 +15,13 @@ Available Commands:
hashdir Get directory hash
help Help about any command
httpbenchmark httpbenchmark tool
opnsense Manage opnsense, start/stop/reconfigure services.
rsa RSA key pair management
semantic-release semantic-release - fully automated package/module/image publishing
zdns Manage zdns cloud zones and record.

Flags:
--config string config file (default is $HOME/.gsmlg/cli.yaml)
--config string config file (default is $HOME/.config/gsmlg/cli.yaml)
-h, --help help for gsmlg-cli
-v, --version Print version

Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func init() {

// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("version", "v", false, "Print version")
rootCmd.Flags().BoolP("version", "", false, "Print version")
}

// initConfig reads in config file and ENV variables if set.
Expand Down Expand Up @@ -104,7 +104,7 @@ func initConfig() {

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

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/gsmlg-dev/gsmlg-golang => ../gsmlg-golang

0 comments on commit 8eb60cf

Please sign in to comment.