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

Commit

Permalink
fix: update sc to scc to fix issues in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Mar 12, 2022
1 parent 0230178 commit 62dc041
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions api/get-latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func GetLatest(product string, isChecker bool) string {
p = "latest"
} else if product == "secman-core" {
p = "latest-core"
} else if product == "sc" {
p = "latest-sc"
} else if product == "scc" {
p = "latest-scc"
}

url := "https://api.secman.dev/" + p
Expand Down
2 changes: 1 addition & 1 deletion app/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func LogoutCMD() *cobra.Command {
Long: "Logout of the current user account.",
RunE: func(cmd *cobra.Command, args []string) error {
if AuthOpts.ConfirmLogout {
gosh.Run("sc logout")
gosh.Run("scc logout")
msg := "✔ Logged out successfully"

logo := "\n" + lipgloss.NewStyle().
Expand Down
2 changes: 1 addition & 1 deletion app/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func ReadCMD() *cobra.Command {
passwordType = "-s"
}

err, out, errout := gosh.RunOutput("sc read " + passwordType + " " + PwOpts.Password + " " + showHiddenFlag)
err, out, errout := gosh.RunOutput("scc read " + passwordType + " " + PwOpts.Password + " " + showHiddenFlag)

if err != nil {
fmt.Println(errout)
Expand Down
2 changes: 1 addition & 1 deletion core/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Secman Core CLI (sc)
# Secman Core CLI (scc)

> secman core cli is a command line interface for the secman core library.
8 changes: 4 additions & 4 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@secman/sc",
"name": "@secman/scc",
"description": "The command-line interface of Secman Core",
"version": "0.1.1",
"main": "lib/index.js",
Expand All @@ -26,7 +26,7 @@
"build": "rimraf lib && tsc -b && oclif-dev manifest"
},
"bin": {
"sc": "./bin/run"
"scc": "./bin/run"
},
"dependencies": {
"@oclif/command": "^1",
Expand Down Expand Up @@ -72,8 +72,8 @@
],
"oclif": {
"commands": "./lib/src/commands",
"bin": "sc",
"dirname": "sc",
"bin": "scc",
"dirname": "scc",
"helpClass": "./lib/src/help",
"hooks": {
"init": "./lib/src/hooks/init/version"
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func spinnerView(m model) string {

func sma(m model) tea.Cmd {
return func() tea.Msg {
err, out, errout := gosh.RunOutput("sc auth -e " + m.inputs[0].Value() + " -m " + m.inputs[1].Value())
err, out, errout := gosh.RunOutput("scc auth -e " + m.inputs[0].Value() + " -m " + m.inputs[1].Value())

if err != nil {
log.Printf("error: %v\n", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/logout/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func spinnerView(m model) string {

func sml(m model) tea.Cmd {
return func() tea.Msg {
gosh.Run("sc logout")
gosh.Run("scc logout")

return shared.SuccessMsg{}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/refresh/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func spinnerView(m model) string {

func smr(m model) tea.Cmd {
return func() tea.Msg {
err, out, _ := gosh.RunOutput("sc auth -e " + user + " -m " + m.ms)
err, out, _ := gosh.RunOutput("scc auth -e " + user + " -m " + m.ms)

if err != nil {
return shared.Message{err}
Expand Down
6 changes: 3 additions & 3 deletions pkg/doctor/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
)

var (
_, err = looker.LookPath("sc")
_, err = looker.LookPath("scc")

smVersionStatus = ""
scStatus = ""
scVersionStatus = ""
secmanConfigStatus = ""
latestVersion = api.GetLatest("secman-cli", false)
latestSCVersion = api.GetLatest("sc", false)
outErr, out, errout = gosh.RunOutput("sc -v")
latestSCVersion = api.GetLatest("scc", false)
outErr, out, errout = gosh.RunOutput("scc -v")
configErr = viper.ReadConfig(bytes.NewBuffer(constants.SecmanConfig()))
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/doctor/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Fix(buildVersion string) {
bug4 string
)

_, out, _ := gosh.RunOutput("sc -v")
_, out, _ := gosh.RunOutput("scc -v")
if out != "" {
out = out[:len(out)-1]
}
Expand All @@ -30,12 +30,12 @@ func Fix(buildVersion string) {
}

if err != nil {
bug2 = "to install secman core cli run " + CommandStyle("`npm i -g @secman/sc`")
bug2 = "to install secman core cli run " + CommandStyle("`npm i -g @secman/scc`")
}

if err == nil {
if latestSCVersion != out {
bug3 = "to upgrade secman core cli to the latest version run " + CommandStyle("`npm update -g @secman/sc`")
bug3 = "to upgrade secman core cli to the latest version run " + CommandStyle("`npm update -g @secman/scc`")
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func Info(version string) {
err, smcVersion, _ := gosh.RunOutput("sc -v")
err, smcVersion, _ := gosh.RunOutput("scc -v")
user := "`" + config.Config("config.name") + "`"

if user == "``" {
Expand All @@ -21,7 +21,7 @@ func Info(version string) {
smcVersion = smcVersion[:len(smcVersion)-1]

if err != nil {
fmt.Println("could not get sc version")
fmt.Println("could not get scc version")
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/pipe/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Delete(o *options.PasswordsOptions) model {
st := shared.DefaultStyles()
var p = fmt.Sprintf("\"%s\"", o.Password)

var err, out, _ = gosh.RunOutput("sc delete " + shared.PasswordType(o) + " " + p)
var err, out, _ = gosh.RunOutput("scc delete " + shared.PasswordType(o) + " " + p)

return model{
styles: st,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipe/edit/editor/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func spinnerView(m model) string {

func sme(m model) tea.Cmd {
return func() tea.Msg {
err, out, errout := gosh.RunOutput("sc edit " + m.pwType + " " + m.password + " -f " + fmt.Sprintf("\"%s\"", m.field) + " -v " + fmt.Sprintf("\"%s\"", m.value))
err, out, errout := gosh.RunOutput("scc edit " + m.pwType + " " + m.password + " -f " + fmt.Sprintf("\"%s\"", m.field) + " -v " + fmt.Sprintf("\"%s\"", m.value))

if err != nil {
fmt.Println(errout)
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipe/insert/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func spinnerView(m model) string {

func smi(m model) tea.Cmd {
return func() tea.Msg {
insCmd := "sc insert "
insCmd := "scc insert "
cmd := ""
extra := "no-extra"

Expand Down
2 changes: 1 addition & 1 deletion pkg/pipe/lister/passwords.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func readPasswords(p string) []list.Item {
s.Suffix = " 📡 Preparing & Getting data..."
s.Start()

err, out, errout := gosh.RunOutput("sc . " + p)
err, out, errout := gosh.RunOutput("scc . " + p)

if err != nil {
fmt.Println(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipe/read/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Read(o *options.PasswordsOptions) model {
s.Suffix = " 📡 Preparing & Getting data..."
s.Start()

var err, out, errout = gosh.RunOutput("sc read " + shared.PasswordType(o) + " " + p + " " + isHidden())
var err, out, errout = gosh.RunOutput("scc read " + shared.PasswordType(o) + " " + p + " " + isHidden())

if err != nil {
fmt.Println(err)
Expand Down

0 comments on commit 62dc041

Please sign in to comment.