|
@@ -90,7 +90,8 @@ func parseTomlFromFile(filePath string) (PestConfig, error) {
|
|
func gitGetHead(filePath string) (string, string) {
|
|
func gitGetHead(filePath string) (string, string) {
|
|
gitObj, err := git.PlainOpen(filePath)
|
|
gitObj, err := git.PlainOpen(filePath)
|
|
if err != nil {
|
|
if err != nil {
|
|
- panic(err)
|
|
|
|
|
|
+ // Likely not a git dir, return empty
|
|
|
|
+ return "", ""
|
|
}
|
|
}
|
|
|
|
|
|
headRef, err := gitObj.Head()
|
|
headRef, err := gitObj.Head()
|
|
@@ -209,7 +210,7 @@ func assemble_prompt(config *PestConfig) {
|
|
|
|
|
|
func main() {
|
|
func main() {
|
|
|
|
|
|
- toml, err := parseTomlFromFile("./pest.cfg")
|
|
|
|
|
|
+ toml, err := parseTomlFromFile("/home/swatson/Repos/go-pest/pest.cfg")
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println("Couldn't parse TOML const!")
|
|
fmt.Println("Couldn't parse TOML const!")
|
|
}
|
|
}
|