Initial implementation of config file

This commit is contained in:
David J. Allen 2023-10-19 17:08:36 -06:00
parent 1db4349eb0
commit 2baae37f5f
9 changed files with 672 additions and 19 deletions

View file

@ -8,6 +8,8 @@ import (
"net"
"net/http"
"os"
"path/filepath"
"strings"
"time"
)
@ -78,4 +80,10 @@ func MakeOutputDirectory(path string) (string, error) {
return final, fmt.Errorf("could not make directory: %v", err)
}
return final, nil
}
}
func SplitPathForViper(path string) (string, string, string) {
filename := filepath.Base(path)
ext := filepath.Ext(filename)
return filepath.Dir(path), strings.TrimSuffix(filename, ext), strings.TrimPrefix(ext, ".")
}