forked from mirrors/nixpkgs
* Add file support in the runHook function.
svn path=/nixpkgs/branches/stdenv-updates/; revision=18467
This commit is contained in:
parent
8c638e5e68
commit
6ba27ab552
|
@ -4,11 +4,12 @@
|
|||
# environment variables) and from shell scripts (as functions).
|
||||
runHook() {
|
||||
local hookName="$1"
|
||||
if test "$(type -t $hookName)" = function; then
|
||||
$hookName
|
||||
else
|
||||
eval "${!hookName}"
|
||||
fi
|
||||
case "$(type -t $hookName)" in
|
||||
(function|alias|builtin) $hookName;;
|
||||
(file) source $hookName;;
|
||||
(keyword) :;;
|
||||
(*) eval "${!hookName}";;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue