From 52396e455c4ccb9cd9d575f0689f00025c3516a3 Mon Sep 17 00:00:00 2001 From: Emil Ingerslev Date: Tue, 11 Dec 2018 08:16:10 +0100 Subject: [PATCH] Fix use of absolute path in project option --- cmd/root.go | 8 +++++++- tests.sh | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 526a401..a88eebf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -66,7 +66,13 @@ func getProjectContext() config.ShuttleProjectContext { os.Exit(1) } - var fullProjectPath = path.Join(dir, projectPath) + var fullProjectPath string + if path.IsAbs(projectPath) { + fullProjectPath = projectPath + } else { + fullProjectPath = path.Join(dir, projectPath) + } + var c config.ShuttleProjectContext c.Setup(fullProjectPath, uii, clean, skipGitPlanPulling) return c diff --git a/tests.sh b/tests.sh index 7e1a088..6dd4351 100755 --- a/tests.sh +++ b/tests.sh @@ -24,6 +24,10 @@ test_moon_base_builds() { assertRun -p examples/moon-base run build tag=test } +test_moon_base_builds_with_absolute_path() { + assertRun -p $(pwd)/examples/moon-base run build tag=test +} + test_venus_base_fails() { assertErrorCode 2 -p examples/venus-base run build tag=test }