X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrush%2Fdrush%2Fsrc%2FRuntime%2FTildeExpansionHook.php;fp=vendor%2Fdrush%2Fdrush%2Fsrc%2FRuntime%2FTildeExpansionHook.php;h=befb55d8498c7aad0e89b1af0570103f63e4bb75;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/drush/drush/src/Runtime/TildeExpansionHook.php b/vendor/drush/drush/src/Runtime/TildeExpansionHook.php new file mode 100644 index 000000000..befb55d84 --- /dev/null +++ b/vendor/drush/drush/src/Runtime/TildeExpansionHook.php @@ -0,0 +1,47 @@ +input(); + $args = $input->getArguments(); + $options = $input->getOptions(); + + foreach ($options as $name => $value) { + if (is_string($value)) { + $replaced = StringUtils::replaceTilde($value, $this->getConfig()->home()); + if ($value != $replaced) { + $input->setOption($name, $replaced); + } + } + } + foreach ($args as $name => $value) { + if (is_string($value)) { + $replaced = StringUtils::replaceTilde($value, $this->getConfig()->home()); + if ($value != $replaced) { + $input->setArgument($name, $replaced); + } + } + } + } +}