Skip to content

Commit

Permalink
smaller updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jryannel committed Aug 31, 2023
1 parent 4706f69 commit 2d6dffd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions pkg/cfg/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ func Get(key string) any {
return result
}

func GetBool(key string) bool {
rw.RLock()
result := v.GetBool(key)
rw.RUnlock()
return result
}

func SetBool(key string, value bool) {
rw.Lock()
v.Set(key, value)
rw.Unlock()
}

func GetString(key string) string {
rw.RLock()
result := v.GetString(key)
Expand Down
7 changes: 6 additions & 1 deletion pkg/prj/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ func OpenEditor(d string) error {
return fmt.Errorf("find editor %s: %s", editor, err)
}
cmd := exec.Command(path, d)
return cmd.Run()
err = cmd.Run()
if err != nil {
log.Error().Err(err).Msgf("run editor %s from %s", editor, path)
return fmt.Errorf("run editor %s: %s", editor, err)
}
return nil
}

func OpenStudio(d string) error {
Expand Down

0 comments on commit 2d6dffd

Please sign in to comment.