Remove logging errors from security commands

This commit is contained in:
Jay Gabriels
2022-10-20 21:27:33 -07:00
parent 74c0694347
commit ea5cb993d3
3 changed files with 13 additions and 15 deletions

View File

@@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
## [1.8.9] - unreleased
### Added
### Changed
### Deprecated
### Removed
- Logging errors from security commands
### Fixed
### Security
## [1.8.8] - 10/11/22
### Added
- Filename length limit on gitlab repos with name collisions

View File

@@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)
const ghorgVersion = "v1.8.8"
const ghorgVersion = "v1.8.9"
var versionCmd = &cobra.Command{
Use: "version",

View File

@@ -3,7 +3,6 @@ package configs
import (
"errors"
"fmt"
"log"
"os"
"os/exec"
@@ -12,7 +11,6 @@ import (
"runtime"
"strings"
"github.com/gabrie30/ghorg/colorlog"
"github.com/gabrie30/ghorg/scm"
"github.com/gabrie30/ghorg/utils"
@@ -180,10 +178,7 @@ func getOrSetGitHubToken() {
return
}
cmd := `security find-internet-password -s github.com | grep "acct" | awk -F\" '{ print $4 }'`
out, err := exec.Command("bash", "-c", cmd).Output()
if err != nil {
colorlog.PrintError(fmt.Sprintf("Failed to execute command: %s", cmd))
}
out, _ := exec.Command("bash", "-c", cmd).Output()
token = strings.TrimSuffix(string(out), "\n")
@@ -205,10 +200,7 @@ func getOrSetGitLabToken() {
return
}
cmd := `security find-internet-password -s gitlab.com | grep "acct" | awk -F\" '{ print $4 }'`
out, err := exec.Command("bash", "-c", cmd).Output()
if err != nil {
colorlog.PrintError(fmt.Sprintf("Failed to execute command: %s", cmd))
}
out, _ := exec.Command("bash", "-c", cmd).Output()
token = strings.TrimSuffix(string(out), "\n")
@@ -223,10 +215,7 @@ func getOrSetBitBucketToken() {
return
}
cmd := `security find-internet-password -s bitbucket.com | grep "acct" | awk -F\" '{ print $4 }'`
out, err := exec.Command("bash", "-c", cmd).Output()
if err != nil {
colorlog.PrintError(fmt.Sprintf("Failed to execute command: %s", cmd))
}
out, _ := exec.Command("bash", "-c", cmd).Output()
token = strings.TrimSuffix(string(out), "\n")