Skip to content

Commit

Permalink
cli: remove metadata.yaml from migrations directory after update-conf…
Browse files Browse the repository at this point in the history
…ig-v2 script (fixes #6112)

GITHUB_PR_NUMBER: 6121
GITHUB_PR_URL: #6121

Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
GitOrigin-RevId: 79836c5
  • Loading branch information
hasura-bot and purush7 committed Feb 18, 2021
1 parent 2e7048c commit 4c75995
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/commands/scripts_update_config_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ func newScriptsUpdateConfigV2Cmd(ec *cli.ExecutionContext) *cobra.Command {
}
ec.Spinner.Stop()
ec.Logger.Infoln("Updated config to version 2")

if f, _ := os.Stat(filepath.Join(ec.MigrationDir, "metadata.yaml")); f != nil {
err = os.Remove(filepath.Join(ec.MigrationDir, "metadata.yaml"))
if err != nil {
ec.Logger.Warnln("Warning: cannot remove metadata.yaml file ",err)
}
}

return nil
},
}
Expand Down

0 comments on commit 4c75995

Please sign in to comment.