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

fix new Environment ps1 files when spaces in path #12653

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conan/tools/env/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def environment_wrap_command(env_filenames, env_folder, cmd, subsystem=None,
return '{} && {}'.format(launchers, cmd)
elif ps1s:
# TODO: at the moment it only works with path without spaces
Copy link
Member

Choose a reason for hiding this comment

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

This comment is probably not needed anymore 👀

launchers = " ; ".join('{}'.format(f) for f in ps1s)
launchers = " ; ".join('"&\'{}\'"'.format(f) for f in ps1s)
return 'powershell.exe {} ; cmd /c {}'.format(launchers, cmd)
else:
return cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
import pytest

from conans.test.assets.genconanfile import GenConanfile
from conans.test.utils.test_files import temp_folder
from conans.test.utils.tools import TestClient
from conans.tools import save


@pytest.fixture
def client():
client = TestClient(path_with_spaces=False)
# We use special characters and spaces, to check everything works
# https://github.com/conan-io/conan/issues/12648
cache_folder = os.path.join(temp_folder(), "[sub] folder")
client = TestClient(cache_folder)
conanfile = str(GenConanfile("pkg", "0.1"))
conanfile += """

Expand Down