@@ -6,35 +6,40 @@ import (
66
77 "os"
88
9- "github.com/RohitRavindra-dev/devlocal/internal/configs "
9+ "github.com/RohitRavindra-dev/devlocal/internal/config "
1010
1111 "gopkg.in/yaml.v3"
1212)
1313
1414func createRootDirectory () error {
15- _ , err := os .Stat (configs .PROJECT_ROOT )
15+ _ , err := os .Stat (config .PROJECT_ROOT )
1616 if err == nil {
17- return fmt .Errorf ("%s already exists, please run cleanup" , configs .PROJECT_ROOT )
17+ return fmt .Errorf (
18+ "%s is already initialized in this root. " +
19+ "To re-initialize, first run `devlocal cleanup` " +
20+ "and then rerun `devlocal init`" ,
21+ config .PROJECT_ROOT ,
22+ )
1823 }
1924
2025 if ! os .IsNotExist (err ) {
2126 return err
2227 }
2328
24- return os .Mkdir (configs .PROJECT_ROOT , 0755 )
29+ return os .Mkdir (config .PROJECT_ROOT , 0755 )
2530}
2631
2732func createConfigFile () error {
2833 err := os .WriteFile (
29- filepath .Join (configs .PROJECT_ROOT , " config.yaml" ),
34+ filepath .Join (config .PROJECT_ROOT , config .CONFIG_FILE_NAME ),
3035 []byte ("" ),
3136 0644 ,
3237 )
3338 return err
3439}
3540
3641func seedYamlConfigFile () error {
37- initYamlConfig := configs .DevlocalConfigYaml {
42+ initYamlConfig := config .DevlocalConfigYaml {
3843 Version : 1 ,
3944 Overlook : []string {},
4045 Patches : []string {},
@@ -46,7 +51,7 @@ func seedYamlConfigFile() error {
4651 return err
4752 }
4853
49- return os .WriteFile (filepath .Join (configs .PROJECT_ROOT , configs .CONFIG_FILE_NAME ), data , 0644 )
54+ return os .WriteFile (filepath .Join (config .PROJECT_ROOT , config .CONFIG_FILE_NAME ), data , 0644 )
5055}
5156
5257func InitilizeDevLocalFilesystem () error {
0 commit comments