.env init
This commit is contained in:
10
main.go
10
main.go
@@ -260,6 +260,16 @@ func runInit() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
envPath := filepath.Join(cwd, ".env")
|
||||||
|
if _, err := os.Stat(envPath); err != nil {
|
||||||
|
if !errors.Is(err, os.ErrNotExist) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := os.WriteFile(envPath, []byte("# PocketBase env overrides\n"), 0o644); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf("Initialized PocketBase project %q\n", serviceName)
|
fmt.Printf("Initialized PocketBase project %q\n", serviceName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user