Skip to content

Commit

Permalink
Fix use of absolute path in project option
Browse files Browse the repository at this point in the history
  • Loading branch information
emilingerslev committed Dec 11, 2018
1 parent 56fced6 commit 52396e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 52396e4

Please sign in to comment.