mirror of
https://github.com/Gioni06/terminal.css
synced 2025-03-08 23:59:03 -05:00
17 lines
350 B
Go
17 lines
350 B
Go
package build
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
// ensureDirectoryExists ensures that the directory at the given path exists and creates it if it doesn't.
|
|
func ensureDirectoryExists(path string) {
|
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
|
err := os.MkdirAll(path, 0755)
|
|
if err != nil {
|
|
log.Fatalf("Error creating directory: %v", err)
|
|
}
|
|
}
|
|
}
|