Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make self.project_dir not hardcoded to '.' in TopLevelCommand #4709

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions compose/cli/main.py
Expand Up @@ -111,7 +111,7 @@ def perform_command(options, handler, command_options):
handler(command, options, command_options)
return

project = project_from_options('.', options)
project = project_from_options(self.project_dir, options)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ought to be command.project_dir, I think.

command = TopLevelCommand(project)
with errors.handle_connection_errors(project.client):
handler(command, command_options)
Expand Down Expand Up @@ -203,7 +203,7 @@ class TopLevelCommand(object):

def __init__(self, project, project_dir='.'):
self.project = project
self.project_dir = '.'
self.project_dir = project_dir

def build(self, options):
"""
Expand Down Expand Up @@ -256,7 +256,7 @@ def bundle(self, config_options, options):
-o, --output PATH Path to write the bundle file to.
Defaults to "<project name>.dab".
"""
self.project = project_from_options('.', config_options)
self.project = project_from_options(self.project_dir, config_options)
compose_config = get_config_from_options(self.project_dir, config_options)

output = options["--output"]
Expand Down Expand Up @@ -289,7 +289,7 @@ def config(self, config_options, options):
image_digests = None

if options['--resolve-image-digests']:
self.project = project_from_options('.', config_options)
self.project = project_from_options(self.project_dir, config_options)
image_digests = image_digests_for_project(self.project)

if options['--quiet']:
Expand Down