Skip to content

Commit

Permalink
chore: move list of non-context commands to constant (#3485)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsin authored Dec 6, 2024
1 parent 35a3b15 commit a7e75dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlmesh/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
logger = logging.getLogger(__name__)

SKIP_LOAD_COMMANDS = ("create_external_models", "migrate", "rollback", "run")
SKIP_CONTEXT_COMMANDS = ("init", "ui")


def _sqlmesh_version() -> str:
Expand Down Expand Up @@ -80,7 +81,7 @@ def cli(

if len(paths) == 1:
path = os.path.abspath(paths[0])
if ctx.invoked_subcommand in ("init", "ui"):
if ctx.invoked_subcommand in SKIP_CONTEXT_COMMANDS:
ctx.obj = path
return
elif ctx.invoked_subcommand in SKIP_LOAD_COMMANDS:
Expand Down

0 comments on commit a7e75dc

Please sign in to comment.