-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support configuring tasks to run in the original working directory (#161
) The EnvVarsManager now sets an new environment variable `"POE_PWD"` (if not already set) to the path of the current working directory of the process. The variable can then be referenced from the cwd option of a task using the usual variable templating syntax `${}` to make a task run in (or relative to) the user's current working directory instead of relative to the project root. --------- Co-authored-by: Nat Noordanus <[email protected]>
- Loading branch information
Showing
12 changed files
with
144 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
[tool.poe.tasks.cwd] | ||
cmd = "poe_test_pwd" | ||
cwd = "./subdir/foo" | ||
|
||
[tool.poe.tasks.cwd_env] | ||
cmd = "poe_test_pwd" | ||
cwd = "./subdir/${BAR_ENV}" | ||
|
||
[tool.poe.tasks.cwd_poe_pwd] | ||
cmd = "poe_test_pwd" | ||
cwd = "${POE_PWD}" | ||
|
||
[tool.poe.tasks.cwd_arg] | ||
cmd = "poe_test_pwd" | ||
cwd = "./subdir/${foo_var}" | ||
args = ["foo_var"] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
|
||
[tool.poe.tasks.get_cwd_3] | ||
interpreter = "python" | ||
shell = "import os; print(os.getcwd())" | ||
cwd = "${POE_PWD}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters