Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
fix shell errors, rename test_detect_os.rb -> upg_test.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Mar 5, 2021
1 parent e007784 commit 1cce3f2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
12 changes: 6 additions & 6 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,17 @@ func init() {
RootCmd.AddCommand(verxCmd)
}

const clone string = "git clone https://github.com/secman-team/"
const winCmd string = clone + "sm-win ~/sm"
const cmd string = clone + "sm /home/sm"

func loading(text string) {
s := spinner.New(spinner.CharSets[35], 100*time.Millisecond)
s.Suffix = " " + text
s.Start()
s.Stop()
}

const clone string = "git clone https://github.com/secman-team/"
const winCmd string = clone + "sm-win ~/sm"
const cmd string = clone + "sm /home/sm"

// main
func main() {
if runtime.GOOS == "windows" {
Expand All @@ -241,7 +241,7 @@ func main() {
} else {
loading("installing windows deps...")

SHCore(cmd, winCmd)
shell.SHCore(cmd, winCmd)

RootCmd.Execute()
}
Expand All @@ -253,7 +253,7 @@ func main() {
} else {
loading("installing linux/macos deps...")

SHCore(cmd, winCmd)
shell.SHCore(cmd, winCmd)

RootCmd.Execute()
}
Expand Down
4 changes: 1 addition & 3 deletions fetch/fetch.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package fetch

import (
"fmt"
"os/exec"
"time"

"github.com/briandowns/spinner"
Expand All @@ -14,7 +12,7 @@ func FetchSECDIR() {
s.Suffix = " Fetching..."
s.Start()

SHCore("secman-sync pl", "bash ssc pl")
shell.SHCore("secman-sync pl", "bash ssc pl")

s.Stop()
}
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/secman-team/shell v0.1.0 h1:cTqRgG7Oqhst/s/z/CERg/+ZgSOxE/qK9ctM/B9wHdQ=
github.com/secman-team/shell v0.1.0/go.mod h1:+kAfttTSmyjzVbKIksunNkDxJONomZp52cwY/PgCHHs=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
Expand Down
2 changes: 1 addition & 1 deletion plugins/shell
Submodule shell updated from 2a1774 to d929c0
15 changes: 2 additions & 13 deletions upgrade/upg.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
package upg

import (
"fmt"
"os/exec"
)
import "github.com/secman-team/shell"

func Upgrade() {
cmd := exec.Command("verx", "--upg")
stdout, err := cmd.Output()

if err != nil {
fmt.Println(err.Error())
return
}

fmt.Print(string(stdout))
shell.SHCore("verx --upg", "bash vx --upg")
}
File renamed without changes.

0 comments on commit 1cce3f2

Please sign in to comment.