Skip to content

Commit

Permalink
update: ubuntu.go
Browse files Browse the repository at this point in the history
move IsUbuntu() function up like other arch/termux, following the syntax.
  • Loading branch information
whyakari authored Jul 16, 2023
1 parent d1420c2 commit 9394f2a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions pkg/ubuntu/ubuntu.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import (
"strings"
)

func IsUbuntu() bool {

fmt.Println("Installing setup of the neovim, wait...")

out, err := exec.Command("bash", "-c", "cat /etc/os-release | grep -oP '(?<=^ID=).+'").Output()
if err != nil {
return false
}
return strings.TrimSpace(string(out)) == "ubuntu"
}

func UbuntuCommands() []string {
return []string{
"apt update",
Expand All @@ -21,15 +32,3 @@ func UbuntuCommands() []string {
"rm -rf $HOME/nvim",
}
}

func IsUbuntu() bool {

fmt.Println("Installing setup of the neovim, wait...")

out, err := exec.Command("bash", "-c", "cat /etc/os-release | grep -oP '(?<=^ID=).+'").Output()
if err != nil {
return false
}
return strings.TrimSpace(string(out)) == "ubuntu"
}

0 comments on commit 9394f2a

Please # to comment.