From 963c57055756d0216267d3bbed4f614e8ee2f0bf Mon Sep 17 00:00:00 2001 From: mochi-MizLab Date: Thu, 22 Jul 2021 21:22:46 +0900 Subject: [PATCH] :hammer: unify the project/application name --- .github/workflows/autorelease.yml | 4 ++-- .goreleaser.yml | 4 ++-- README.md | 24 +++++++++++++----------- main.go | 9 +++++---- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/autorelease.yml b/.github/workflows/autorelease.yml index baf7ad6..24ca877 100644 --- a/.github/workflows/autorelease.yml +++ b/.github/workflows/autorelease.yml @@ -1,7 +1,7 @@ name: goreleaser -on: - push: +on: + push: tags: - "v[0-9]+.[0-9]+.[0-9]+" diff --git a/.goreleaser.yml b/.goreleaser.yml index ae2496e..c6b10b6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,4 @@ -project_name: deepl-translation-cli +project_name: deepl-translate-cli env: - GO111MODULE=on before: @@ -6,7 +6,7 @@ before: - go mod tidy builds: - main: . - binary: deepl-translation + binary: deepl-translate-cli ldflags: - -s -w - -X main.Version={{.Version}} diff --git a/README.md b/README.md index 3b55691..4c5539d 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,14 @@ 1. Get deepl access token. See [here](https://www.deepl.com/docs-api). 2. Set access token as `DEEPL_TOKEN` - ex. in `Bash`. - ```bash - export DEEPL_TOKEN - ``` -3. Make configure file in `/.config/deepl-translation/setting.json`. + ex. in `Bash`. + + ```bash + export DEEPL_TOKEN + ``` + +3. Make configure file in `/.config/deepl-translate-cli/setting.json`. If run command without existing setting file, auto make it. @@ -28,17 +30,17 @@ ## Usage - If you want translate from existing file. -```console -$ deepl-translation -``` + ```console + $ deepl-translate-cli + ``` - If you want use stdin. - - with pipe + - with pipe ```console - $ echo "hello" | deepl-translation --stdin + $ echo "hello" | deepl-translate-cli --stdin ``` - with input ```console - $ deepl-translation --stdin + $ deepl-translate-cli --stdin ``` diff --git a/main.go b/main.go index 57844c3..ac9d79c 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ func LoadSettings(c *cli.Context) (Setting, error) { return setting, err } - configPath := filepath.Join(homeDir, ".config", "deepl-translation", "setting.json") + configPath := filepath.Join(homeDir, ".config", "deepl-translate-cli", "setting.json") bytes, err := ioutil.ReadFile(configPath) if err != nil { errStr := fmt.Errorf("Not exists such file. %s\n\tauto make it, please write it. ", configPath) @@ -141,13 +141,14 @@ func ParseResponse(resp *http.Response) (Response, error) { func main() { app := &cli.App{ - Name: "deepl", + Name: "deepl-translate-cli", Usage: "Translate sentences.", - UsageText: "deepl [-s|-t] ", + UsageText: "deepl-translate-cli [-s|-t] ", Version: fmt.Sprintf("%s (rev %s) [%s %s %s] [build at %s by %s]", version, commit, runtime.GOOS, runtime.GOARCH, runtime.Version(), date, buildBy), Authors: []*cli.Author{ &cli.Author{ - Name: "Omochice"}, + Name: "Omochice", + }, }, Flags: []cli.Flag{