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 - name: Replace PKGVER, SHA256SUMS_X86_64 in PKGBUILD
run: | run: |
sed -i "s/PKGVER/$(echo ${{ env.VERSION }} | cut -c2-)/g" build/PKGBUILD 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 sed -i "s/SHA256SUMS_X86_64/$(sha256sum gtt-linux-amd64.tar.gz | awk '{print $1}')/g" build/PKGBUILD
- name: Publish to the AUR - name: Publish to the AUR

View File

@ -1,4 +1,6 @@
# GTT # gtt
Google Translate TUI (Originally)
Support: Support:
[`ArgosTranslate`](https://translate.argosopentech.com/), [`ArgosTranslate`](https://translate.argosopentech.com/),
@ -18,12 +20,12 @@ yay -S gtt-bin
### Prebuild ### 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 ### From source
``` ```
go get && go build go install github.com/eeeXun/gtt@latest
``` ```
### Run on Docker ### Run on Docker

View File

@ -2,7 +2,7 @@ FROM ubuntu:latest
ARG VERSION ARG VERSION
RUN apt update && apt install -y wget libasound2-dev 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/ RUN tar -xvf gtt-linux-amd64.tar.gz -C /usr/bin/
ENV TERM xterm-256color ENV TERM xterm-256color

View File

@ -4,9 +4,9 @@ pkgname=gtt-bin
pkgver=PKGVER pkgver=PKGVER
pkgrel=1 pkgrel=1
pkgdesc='Translate TUI in Golang' pkgdesc='Translate TUI in Golang'
url='https://github.com/eeeXun/GTT' url='https://github.com/eeeXun/gtt'
license=('MIT') 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') arch=('x86_64')
depends=('alsa-lib') depends=('alsa-lib')
optdepends=('xclip: for clipboard support on X11' 'wl-clipboard: for clipboard support on Wayland') optdepends=('xclip: for clipboard support on X11' 'wl-clipboard: for clipboard support on Wayland')

View File

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

2
go.mod
View File

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

View File

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

View File

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

View File

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

View File

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

4
ui.go
View File

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