Skip to content

Commit

Permalink
Merge branch 'v2' into etcbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
axtloss authored Nov 5, 2023
2 parents 9d698ef + 1f12c7e commit db5bbb5
Show file tree
Hide file tree
Showing 809 changed files with 33,411 additions and 20,325 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/go-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: registry.vanillaos.org/vanillaos/pico:main
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v3
Expand All @@ -31,6 +31,15 @@ jobs:

- name: Test
run: go test -v ./tests/..

- name: Compress
run: tar -czvf abrootv2.tar.gz abrootv2

- uses: actions/upload-artifact@v3
with:
name: abrootv2
path: abrootv2.tar.gz

sonar:
name: Sonar
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: registry.vanillaos.org/vanillaos/pico:main
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v3
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/goreleaser.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Install build dependencies
run: |
apt-get update
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential
- name: Build
run: go build -o abrootv2

- name: Compress
run: tar -czvf abrootv2.tar.gz abrootv2

- uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
files: |
abrootv2.tar.gz
1 change: 0 additions & 1 deletion abroot_kargs

This file was deleted.

45 changes: 37 additions & 8 deletions cmd/kargs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ package cmd
*/

import (
"errors"

"github.com/spf13/cobra"

"github.com/vanilla-os/abroot/core"
"github.com/vanilla-os/orchid/cmdr"
)

var validKargsArgs = []string{"edit", "list"}
var validKargsArgs = []string{"edit", "show"}

func NewKargsCommand() *cmdr.Command {
cmd := cmdr.NewCommand(
Expand All @@ -30,13 +32,6 @@ func NewKargsCommand() *cmdr.Command {
kargs,
)

cmd.WithBoolFlag(
cmdr.NewBoolFlag(
"check-only",
"c",
abroot.Trans("kargs.checkOnlyFlag"),
false))

cmd.Args = cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs)
cmd.ValidArgs = validKargsArgs
cmd.Example = "abroot kargs edit"
Expand All @@ -50,5 +45,39 @@ func kargs(cmd *cobra.Command, args []string) error {
return nil
}

switch args[0] {
case "edit":
changed, err := core.KargsEdit()
if err != nil {
cmdr.Error.Println(err)
return err
}

if !changed {
cmdr.Info.Println(abroot.Trans("kargs.notChanged"))
return nil
}

aBsys, err := core.NewABSystem()
if err != nil {
cmdr.Error.Println(err)
return err
}
err = aBsys.RunOperation(core.APPLY)
if err != nil {
cmdr.Info.Println(abroot.Trans("pkg.applyFailed"))
return err
}
case "show":
kargsStr, err := core.KargsRead()
if err != nil {
cmdr.Error.Println(err)
return err
}
cmdr.Info.Println(kargsStr)
default:
return errors.New(abroot.Trans("kargs.unknownParam", args[0]))
}

return nil
}
4 changes: 2 additions & 2 deletions cmd/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func pkg(cmd *cobra.Command, args []string) error {
return nil
}

pkgM := core.NewPackageManager()
pkgM := core.NewPackageManager(false)

switch args[0] {
case "add":
Expand Down Expand Up @@ -97,7 +97,7 @@ func pkg(cmd *cobra.Command, args []string) error {

err = aBsys.RunOperation(core.APPLY)
if err != nil {
cmdr.Info.Println(abroot.Trans("pkg.applyFailed"))
cmdr.Error.Printf(abroot.Trans("pkg.applyFailed"), err)
return err
}
}
Expand Down
Loading

0 comments on commit db5bbb5

Please sign in to comment.