Skip to content

Commit

Permalink
improve error message for deploy folder (#16723)
Browse files Browse the repository at this point in the history
* improve error message for deploy folder

* fix
  • Loading branch information
memsharded authored Jul 24, 2024
1 parent 66a3a01 commit 83ab496
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conan/internal/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def _load(path):


def do_deploys(conan_api, graph, deploy, deploy_package, deploy_folder):
mkdir(deploy_folder)
try:
mkdir(deploy_folder)
except Exception as e:
raise ConanException(f"Deployer folder cannot be created '{deploy_folder}':\n{e}")
# handle the recipe deploy()
if deploy_package:
# Similar processing as BuildMode class
Expand Down
12 changes: 12 additions & 0 deletions test/functional/command/test_install_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,18 @@ def package_info(self):
assert f'export MYPATH="{some_abs_path}/mypath"' in env


def test_deploy_incorrect_folder():
# https://github.com/conan-io/cmake-conan/issues/658
c = TestClient()
c.save({"conanfile.txt": ""})
c.run('install . --deployer=full_deploy --deployer-folder="mydep fold"')
assert os.path.exists(os.path.join(c.current_folder, "mydep fold"))
if platform.system() == "Windows": # This only fails in Windows
c.run(r'install . --deployer=full_deploy --deployer-folder="\"mydep fold\""',
assert_error=True)
assert "ERROR: Deployer folder cannot be created" in c.out


class TestRuntimeDeployer:
def test_runtime_deploy(self):
c = TestClient()
Expand Down

0 comments on commit 83ab496

Please sign in to comment.