Initial import

This commit is contained in:
George Suntres
2026-03-29 11:37:56 -04:00
commit 783e21ea9d
4 changed files with 101 additions and 0 deletions

18
fs.go Normal file
View File

@@ -0,0 +1,18 @@
package sys
import (
"runtime"
"path/filepath"
)
func Rootify(path string) string {
return filepath.Join(GetProjectRoot(), path)
}
func GetProjectRoot() string {
_, b, _, _ := runtime.Caller(0)
// b is the absolute path to this specific .go file
// 1st Dir() gets the folder containing the file
// 2nd Dir() gets the parent of that folder
return filepath.Dir(filepath.Dir(b))
}