Skip to content

Commit

Permalink
Merge pull request #115 from 1dustindavis/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
1dustindavis authored May 17, 2021
2 parents dc66ba2 + f78b945 commit 7eb82ac
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions pkg/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type Item struct {
Installer InstallerItem `yaml:"installer"`
Uninstaller InstallerItem `yaml:"uninstaller"`
Version string `yaml:"version"`
BlockingApps []string `yaml:"blocking_apps"`
PreScript string `yaml:"preinstall_script"`
BlockingApps []string `yaml:"blocking_apps"`
PreScript string `yaml:"preinstall_script"`
PostScript string `yaml:"postinstall_script"`
}

Expand Down
24 changes: 12 additions & 12 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ var (
cachePath string

// Define flag defaults
aboutArg bool
aboutDefault = false
configArg string
configDefault = filepath.Join(os.Getenv("ProgramData"), "gorilla/config.yaml")
debugArg bool
debugDefault = false
helpArg bool
helpDefault = false
verboseArg bool
verboseDefault = false
aboutArg bool
aboutDefault = false
configArg string
configDefault = filepath.Join(os.Getenv("ProgramData"), "gorilla/config.yaml")
debugArg bool
debugDefault = false
helpArg bool
helpDefault = false
verboseArg bool
verboseDefault = false
checkOnlyArg bool
checkOnlyDefault = false
versionArg bool
versionDefault = false
versionArg bool
versionDefault = false

// Use a fake function so we can override when testing
osExit = os.Exit
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestGet(t *testing.T) {
AppDataPath: filepath.Clean("c:/cpe/gorilla/"),
Verbose: true,
Debug: true,
CheckOnly: true,
CheckOnly: true,
AuthUser: "johnny",
AuthPass: "pizza",
CachePath: filepath.Clean("c:/cpe/gorilla/cache"),
Expand Down
6 changes: 3 additions & 3 deletions pkg/gorillalog/gorillalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

var (
// Define these config variables at the package scope
debug bool
verbose bool
checkonly bool
debug bool
verbose bool
checkonly bool
)

// TODO rewrite with io.multiwriter
Expand Down
6 changes: 4 additions & 2 deletions pkg/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ func End() {

}

func Print () {
// Print writes the report to stdout instead of writing to disk
// Used in check only mode
func Print() {
// Compile everything
Items["InstalledItems"] = InstalledItems
Items["UninstalledItems"] = UninstalledItems

reportJSON, marshalErr := json.MarshalIndent(Items, "", " ")
fmt.Println(string(reportJSON))
if marshalErr != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/status/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ func getUninstallKeys() (installedItems map[string]RegistryApplication, checkErr

// Both Uninstall paths (64 & 32 bits apps)
regPaths := []string{`Software\Microsoft\Windows\CurrentVersion\Uninstall`,
`Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall`}
`Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall`}

for _, regPath := range regPaths {

// Get the Uninstall key from HKLM
key, checkErr := registry.OpenKey(registry.LOCAL_MACHINE, regPath, registry.READ)
if checkErr != nil {
Expand Down

0 comments on commit 7eb82ac

Please sign in to comment.