v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-20 09:30:21 -07:00

refactor: rename go module

This commit is contained in:
eeeXun 2023-02-11 14:23:07 +08:00
parent 4956efbcc0
commit 34805264b3
11 changed files with 24 additions and 20 deletions

View File

@ -20,7 +20,7 @@ jobs:
- name: Replace PKGVER, SHA256SUMS_X86_64 in PKGBUILD
run: |
sed -i "s/PKGVER/$(echo ${{ env.VERSION }} | cut -c2-)/g" build/PKGBUILD
wget https://github.com/eeeXun/GTT/releases/download/${{ env.VERSION }}/gtt-linux-amd64.tar.gz
wget https://github.com/eeeXun/gtt/releases/download/${{ env.VERSION }}/gtt-linux-amd64.tar.gz
sed -i "s/SHA256SUMS_X86_64/$(sha256sum gtt-linux-amd64.tar.gz | awk '{print $1}')/g" build/PKGBUILD
- name: Publish to the AUR

View File

@ -1,4 +1,6 @@
# GTT
# gtt
Google Translate TUI (Originally)
Support:
[`ArgosTranslate`](https://translate.argosopentech.com/),
@ -18,12 +20,12 @@ yay -S gtt-bin
### Prebuild
Binary file is available in [Release Page](https://github.com/eeeXun/GTT/releases) for Linux and macOS on x86_64.
Binary file is available in [Release Page](https://github.com/eeeXun/gtt/releases) for Linux and macOS on x86_64.
### From source
```
go get && go build
go install github.com/eeeXun/gtt@latest
```
### Run on Docker

View File

@ -2,7 +2,7 @@ FROM ubuntu:latest
ARG VERSION
RUN apt update && apt install -y wget libasound2-dev
RUN wget https://github.com/eeeXun/GTT/releases/download/${VERSION}/gtt-linux-amd64.tar.gz
RUN wget https://github.com/eeeXun/gtt/releases/download/${VERSION}/gtt-linux-amd64.tar.gz
RUN tar -xvf gtt-linux-amd64.tar.gz -C /usr/bin/
ENV TERM xterm-256color

View File

@ -4,9 +4,9 @@ pkgname=gtt-bin
pkgver=PKGVER
pkgrel=1
pkgdesc='Translate TUI in Golang'
url='https://github.com/eeeXun/GTT'
url='https://github.com/eeeXun/gtt'
license=('MIT')
source_x86_64=("gtt-$pkgver-linux-amd64.tar.gz::${url}/releases/download/v${pkgver}/gtt-linux-amd64.tar.gz")
source_x86_64=("gtt-${pkgver}-linux-amd64.tar.gz::${url}/releases/download/v${pkgver}/gtt-linux-amd64.tar.gz")
arch=('x86_64')
depends=('alsa-lib')
optdepends=('xclip: for clipboard support on X11' 'wl-clipboard: for clipboard support on Wayland')

View File

@ -2,10 +2,10 @@ package main
import (
"fmt"
"gtt/internal/color"
"gtt/internal/translate"
"os"
"github.com/eeeXun/gtt/internal/color"
"github.com/eeeXun/gtt/internal/translate"
config "github.com/spf13/viper"
)

2
go.mod
View File

@ -1,4 +1,4 @@
module gtt
module github.com/eeeXun/gtt
go 1.19

View File

@ -4,10 +4,11 @@ import (
"encoding/json"
"errors"
"fmt"
"gtt/internal/lock"
"io/ioutil"
"net/http"
"net/url"
"github.com/eeeXun/gtt/internal/lock"
)
const (

View File

@ -4,10 +4,11 @@ import (
"encoding/json"
"errors"
"fmt"
"gtt/internal/lock"
"io/ioutil"
"net/http"
"net/url"
"github.com/eeeXun/gtt/internal/lock"
)
const (

View File

@ -1,9 +1,9 @@
package translate
import (
"gtt/internal/lock"
"gtt/internal/translate/argostranslate"
"gtt/internal/translate/googletranslate"
"github.com/eeeXun/gtt/internal/lock"
"github.com/eeeXun/gtt/internal/translate/argostranslate"
"github.com/eeeXun/gtt/internal/translate/googletranslate"
)
var (

View File

@ -2,9 +2,9 @@ package main
import (
"flag"
"gtt/internal/translate"
"gtt/internal/ui"
"github.com/eeeXun/gtt/internal/translate"
"github.com/eeeXun/gtt/internal/ui"
"github.com/rivo/tview"
)
@ -59,7 +59,7 @@ func main() {
case *showVersion:
print(version, "\n")
default:
SetTermTitle("GTT")
SetTermTitle("gtt")
configInit()
uiInit()

4
ui.go
View File

@ -2,10 +2,10 @@ package main
import (
"fmt"
"gtt/internal/color"
"gtt/internal/translate"
"strconv"
"github.com/eeeXun/gtt/internal/color"
"github.com/eeeXun/gtt/internal/translate"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)