Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: marguerite/rime-plum-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: marguerite/rime-plum-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 4 commits
  • 12 files changed
  • 1 contributor

Commits on Jun 3, 2023

  1. Copy the full SHA
    474c812 View commit details
  2. replace io/ioutil

    marguerite committed Jun 3, 2023
    Copy the full SHA
    9e646fc View commit details
  3. Copy the full SHA
    453382b View commit details
  4. fix fcitx5's rime_dir

    marguerite committed Jun 3, 2023
    Copy the full SHA
    1864c6f View commit details
Showing with 392 additions and 63 deletions.
  1. +7 −7 .github/workflows/ci.yml
  2. +0 −1 .gitignore
  3. +8 −9 build.go
  4. +1 −1 dir.go
  5. +34 −3 go.mod
  6. +281 −0 go.sum
  7. +6 −7 install_package.go
  8. +2 −2 main.go
  9. +37 −6 package.go
  10. +10 −21 patch.go
  11. +5 −5 remote.go
  12. +1 −1 utils.go
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -10,31 +10,31 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, windows-2016]
os: [ubuntu-20.04, windows-2019]
steps:
- uses: actions/checkout@v2

- name: Install Go
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update && sudo apt-get install golang-1.13
sudo apt-get update && sudo apt-get install golang-1.18
- name: Download Go Modules
run: |
go mod download
- name: Build Package
if: matrix.os == 'windows-2016'
if: matrix.os == 'windows-2019'
run: |
go build
- name: Make AppImage
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-20.04'
run: |
chmod +x build.sh && bash build.sh
- name: Upload Assets
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-20.04'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -44,7 +44,7 @@ jobs:
overwrite: true

- name: Upload Executable
if: matrix.os == 'windows-2016'
if: matrix.os == 'windows-2019'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
go.sum
vendor
17 changes: 8 additions & 9 deletions build.go
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ package main
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
@@ -55,7 +54,7 @@ func overrideDefaultYaml(schemas []string) {
}

d := filepath.Join(filepath.Dir(schemas[0]), "default.yaml")
f, _ := ioutil.ReadFile(d)
f, _ := os.ReadFile(d)
re := regexp.MustCompile(`^config_version:\s+\'(.*)\'$`)
scanner := bufio.NewScanner(strings.NewReader(string(f)))
list := ""
@@ -77,15 +76,15 @@ func overrideDefaultYaml(schemas []string) {
}
}

err := ioutil.WriteFile(d, []byte(list), 0644)
err := os.WriteFile(d, []byte(list), 0644)
if err != nil {
fmt.Printf("failed to write %s\n", d)
os.Exit(1)
}
}

func minEssay(s string) {
f, _ := ioutil.ReadFile(s)
f, _ := os.ReadFile(s)
essay := ""
scanner := bufio.NewScanner(strings.NewReader(string(f)))
re := regexp.MustCompile(`^.*\s+(.*)$`)
@@ -99,15 +98,15 @@ func minEssay(s string) {
}
}
}
err := ioutil.WriteFile(s, []byte(essay), 0644)
err := os.WriteFile(s, []byte(essay), 0644)
if err != nil {
fmt.Printf("failed to write %s\n", s)
os.Exit(1)
}
}

func minLuna(s string) {
f, _ := ioutil.ReadFile(s)
f, _ := os.ReadFile(s)
scanner := bufio.NewScanner(strings.NewReader(string(f)))
luna := ""
re := regexp.MustCompile(`^version:\s+\"(.*)\"$`)
@@ -122,15 +121,15 @@ func minLuna(s string) {
luna += line + "\n"
}
}
err := ioutil.WriteFile(s, []byte(luna), 0644)
err := os.WriteFile(s, []byte(luna), 0644)
if err != nil {
fmt.Printf("failed to write file %s\n", s)
os.Exit(1)
}
}

func minSchema(s string) {
f, _ := ioutil.ReadFile(s)
f, _ := os.ReadFile(s)
scanner := bufio.NewScanner(strings.NewReader(string(f)))
schema := ""
re := regexp.MustCompile(`(\s+version:\s+)\"(.*)\"$`)
@@ -150,7 +149,7 @@ func minSchema(s string) {
}
schema += line + "\n"
}
err := ioutil.WriteFile(s, []byte(schema), 0644)
err := os.WriteFile(s, []byte(schema), 0644)
if err != nil {
fmt.Printf("failed to write file %s\n", s)
os.Exit(1)
2 changes: 1 addition & 1 deletion dir.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ func GetRimeDir() string {

switch RIME_FRONTEND {
case "fcitx5":
return filepath.Join(home, ".config/fcitx5/rime")
return filepath.Join(home, ".local/share/fcitx5/rime")
case "fcitx":
return filepath.Join(home, ".config/fcitx/rime")
case "ibus":
37 changes: 34 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
module github.com/marguerite/rime-plum-go

go 1.15
go 1.17

require (
github.com/cavaliercoder/grab v2.0.0+incompatible
github.com/charmbracelet/bubbletea v0.13.4
github.com/go-git/go-git/v5 v5.4.2
github.com/go-git/go-git/v5 v5.7.0
github.com/marguerite/go-stdlib v0.0.0-20210602094502-966832f216f6
github.com/muesli/termenv v0.8.1
golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b
golang.org/x/sys v0.8.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/console v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading