Skip to content

Commit

Permalink
fix: tern code snapshot uses TERN_MIGRATIONS envvar
Browse files Browse the repository at this point in the history
  • Loading branch information
jackc committed Jun 13, 2024
1 parent 84145e7 commit ae53fa8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,12 @@ func SnapshotCode(cmd *cobra.Command, args []string) {
}

migrationsPath := cliOptions.migrationsPath

// If no migrations path was set in CLI argument look in environment.
if migrationsPath == "" {
migrationsPath = os.Getenv("TERN_MIGRATIONS")
}

migrations, err := migrate.FindMigrations(os.DirFS(migrationsPath))
if err != nil {
fmt.Fprintf(os.Stderr, "Error loading migrations:\n %v\n", err)
Expand Down

0 comments on commit ae53fa8

Please sign in to comment.