Skip to content

Commit

Permalink
Better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dl-tg authored Jul 22, 2023
1 parent 914c026 commit e93865e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
ot getpackage main

import (
"flag"
Expand Down Expand Up @@ -40,9 +40,8 @@ func main() {
// Check and set the path to the YAML config file
if configPath == "" {
savedPath, err := helper.GetConfigDir()
if err != nil {
helper.Fatal("Could not get config path.", false, err)
}
helper.Fatal(fmt.Sprintf("Could not get config path: %s", err), true, err)

if savedPath == "" {
// Construct default paths for the YAML file based on the user's operating system
var unixDefaultPath string = helper.UnixPath(yaml)
Expand Down Expand Up @@ -76,9 +75,7 @@ func main() {
// Store the path in the database
if remember {
err := helper.SaveConfigDir(yamlPath)
if err != nil {
helper.Fatal("Could not store config path.", false, err)
}
helper.Fatal(fmt.Sprintf("Could not save config path: %s", err), true, err)
}
// Scaffold the directory structure using the provided project name and YAML config path
utils.Scaffold(name, yamlPath)
Expand Down

0 comments on commit e93865e

Please sign in to comment.