diff --git a/cmd/status.go b/cmd/status.go index 079a6c3..eb952fe 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -1,6 +1,7 @@ package cmd import ( + "dvs/internal/config" "dvs/internal/file" "dvs/internal/git" "dvs/internal/log" @@ -41,6 +42,12 @@ func runStatusCmd(cmd *cobra.Command, args []string) { os.Exit(1) } + // Get config + _, err = config.Read(gitDir) + if err != nil { + log.Print(log.IconWarning, "Devious is not initialized, run", log.ColorFaint("dvs init "), "to initialize\n") + } + metaPaths, err = meta.GetAllMetaFiles(gitDir) if err != nil { log.Print(log.IconFailure, "Failed to get meta files", log.ColorRed(err)) diff --git a/internal/migrate/storage.go b/internal/migrate/storage.go index dba648a..26d0508 100644 --- a/internal/migrate/storage.go +++ b/internal/migrate/storage.go @@ -67,7 +67,11 @@ func migrateStorageFile(storageDir string, path string, dry bool) (match bool, e func MigrateStorageFiles(dry bool) (files []string, err error) { repoDir, _ := git.GetNearestRepoDir(".") config, err := config.Read(repoDir) - if err != nil { + + if os.IsNotExist(err) { + // No config file, no storage + return nil, nil + } else if err != nil { return nil, err }