From 73ee899204340a65b4a88505558f153d117695b0 Mon Sep 17 00:00:00 2001 From: Josefu Date: Tue, 13 Feb 2024 02:47:11 +1300 Subject: [PATCH] Add GOOSE_MIGRATION_DIR environment variable to the usage instructions (#697) --- README.md | 3 ++- cmd/goose/main.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b1de9c281..ef281fb6a 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ or Set environment key GOOSE_DRIVER=DRIVER GOOSE_DBSTRING=DBSTRING +GOOSE_MIGRATION_DIR=MIGRATION_DIR Usage: goose [OPTIONS] COMMAND @@ -110,7 +111,7 @@ Options: -certfile string file path to root CA's certificates in pem format (only support on mysql) -dir string - directory with migration files (default ".") + directory with migration files (default ".", can be set via the GOOSE_MIGRATION_DIR env variable). -h print help -no-color disable color output (NO_COLOR env variable supported) diff --git a/cmd/goose/main.go b/cmd/goose/main.go index 7d06da25f..685b29b5c 100644 --- a/cmd/goose/main.go +++ b/cmd/goose/main.go @@ -24,7 +24,7 @@ import ( var ( flags = flag.NewFlagSet("goose", flag.ExitOnError) - dir = flags.String("dir", cfg.DefaultMigrationDir, "directory with migration files") + dir = flags.String("dir", cfg.DefaultMigrationDir, "directory with migration files, (GOOSE_MIGRATION_DIR env variable supported)") table = flags.String("table", "goose_db_version", "migrations table name") verbose = flags.Bool("v", false, "enable verbose mode") help = flags.Bool("h", false, "print help")