Skip to content

Commit

Permalink
removed harcoded koff path
Browse files Browse the repository at this point in the history
  • Loading branch information
gmeghnag committed Oct 8, 2024
1 parent c7cf3a7 commit 01cddf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var GetCmd = &cobra.Command{
Koff.FromInput = true
} else {
// gestire le eccezioni se il file non esiste ecc..
file, _ := os.ReadFile("/Users/gmeghnag/.koff/koff.json")
home, _ := os.UserHomeDir()
file, _ := os.ReadFile(home + "/.koff/koff.json")
_ = json.Unmarshal([]byte(file), &koffConfigJson)
dataIn, _ = os.ReadFile(koffConfigJson.InUse.Path)
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ var UseCmd = &cobra.Command{
return fmt.Errorf("\"%s\" is not a regular file", path)
}
}
useContext(path, "/Users/gmeghnag/.koff/koff.json")
home, _ := os.UserHomeDir()
useContext(path, home+"/.koff/koff.json")
return nil
},
}
Expand Down

0 comments on commit 01cddf8

Please sign in to comment.