WIP: Rewrite bpm utils in go #1
@ -31,6 +31,9 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// run checks
|
||||
runChecks()
|
||||
|
||||
// Show summary
|
||||
showSummary()
|
||||
|
||||
@ -68,6 +71,20 @@ func help() {
|
||||
fmt.Println(" -g=<true/false> | Create git repository (Defaults to true)")
|
||||
}
|
||||
|
||||
func runChecks() {
|
||||
if strings.TrimSpace(*directory) == "" {
|
||||
log.Fatalf("No directory was specified!")
|
||||
}
|
||||
|
||||
if strings.TrimSpace(*name) == "" {
|
||||
log.Fatalf("No directory was specified!")
|
||||
}
|
||||
|
||||
if stat, err := os.Stat(path.Join("/etc/bpm-utils/", *template)); err != nil || stat.IsDir() {
|
||||
log.Fatalf("%s is not a valid template file!", *template)
|
||||
}
|
||||
}
|
||||
|
||||
func showSummary() {
|
||||
absPath, err := filepath.Abs(*directory)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user