From 1d81a67e00d793c07b2dcdbaaecc4a8bc982e448 Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Sun, 9 Feb 2025 15:45:42 +0300 Subject: [PATCH] Stuff --- .github/workflows/go.yml | 19 +++++++++++++++++++ .github/workflows/release.yml | 21 +++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 3 +++ go.mod | 4 ++-- main.go | 19 ------------------- 6 files changed, 66 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/go.yml create mode 100644 .github/workflows/release.yml create mode 100644 LICENSE create mode 100644 README.md diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..9cd47b4 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,19 @@ +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.23' + - name: Build + run: go build -v ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7dd30cd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Build and Release Go Binary + +on: + release: + types: [created] + +permissions: + contents: write + packages: write + +jobs: + release-linux-amd64: + name: release linux/amd64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: wangyoucao577/go-release-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: linux + goarch: amd64 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c15ccbd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Syed + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..55e2359 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Tuipart + +Gparted but TUI. diff --git a/go.mod b/go.mod index 1a4217a..ee57a22 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module tuipart -go 1.23.3 +go 1.23 require ( github.com/gdamore/encoding v1.0.0 // indirect - github.com/gdamore/tcell/v2 v2.7.4 // indirect + github.com/gdamore/tcell/v2 v2.7.4 // direct github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/rivo/uniseg v0.4.3 // indirect diff --git a/main.go b/main.go index ee4fcf5..7ed85df 100644 --- a/main.go +++ b/main.go @@ -24,25 +24,6 @@ var symbols []rune func main() { symbols = []rune("󰞔󰪸󰸞") - /* - // ╭───╮ - // │  │ - // ╰───╯ - disk := "nvme0n1" - parts := getPartitions() - mounted_parts(disk, parts) - part_labels(disk, parts) - fmt.Println(parts) - for _, val := range parts { - x, y := get_used_p(disk+"p"+val[0], val[4]) - if y != nil { - fmt.Println(disk+"p"+val[0], val[4], "--") - } else { - fmt.Println(disk+"p"+val[0], val[4], fmt.Sprintf("%.2f%%", x)) - } - } - return - //*/ screen_tmp, err := tcell.NewScreen() if err != nil { log.Fatalf("Error creating screen: %v", err)