In shell, a variable is often considered unset even if it is set to the empty string. In other words, STOW_DIR= stow [args] is an idiomatic alternative to writing: unset STOW_DIR stow [args] and it also has the advantage of temporarily "unsetting" STOW_DIR for a single command. Therefore we should treat STOW_DIR being set to the empty string as equivalent to it not being set at all. Thanks to Cuong Manh Le for highlighting this issue! Fixes #6 - https://github.com/aspiers/stow/issues/6 Closes #5 - https://github.com/aspiers/stow/pull/5
This commit is contained in:
parent
b5dbc3b7b4
commit
d0f3e5458f
2 changed files with 2 additions and 1 deletions
1
THANKS
1
THANKS
|
@ -23,3 +23,4 @@ Christopher Hoobin <christopher.hoobin.edu.au>
|
|||
Adam Spiers <stow@adamspiers.org>
|
||||
Stefano Lattarini
|
||||
Adam Sampson
|
||||
Cuong Manh Le
|
||||
|
|
|
@ -542,7 +542,7 @@ sub sanitize_path_options {
|
|||
$options->{dir} =~ s/ +\z//;
|
||||
}
|
||||
else {
|
||||
$options->{dir} = exists $ENV{STOW_DIR} ? $ENV{STOW_DIR} : getcwd();
|
||||
$options->{dir} = $ENV{STOW_DIR} ? $ENV{STOW_DIR} : getcwd();
|
||||
}
|
||||
|
||||
if (exists $options->{target}) {
|
||||
|
|
Loading…
Reference in a new issue