mirror of
https://github.com/boolean-maybe/tiki
synced 2026-04-21 13:37:20 +00:00
21 lines
409 B
Go
21 lines
409 B
Go
package bootstrap
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/boolean-maybe/tiki/store/tikistore"
|
|
)
|
|
|
|
// EnsureGitRepoOrExit validates that the current directory is a git repository.
|
|
// If not, it prints an error message and exits the program.
|
|
func EnsureGitRepoOrExit() {
|
|
if tikistore.IsGitRepo("") {
|
|
return
|
|
}
|
|
_, err := fmt.Fprintln(os.Stderr, "Not a git repository")
|
|
if err != nil {
|
|
return
|
|
}
|
|
os.Exit(1)
|
|
}
|