* 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).
|
# environment variables) and from shell scripts (as functions).
|
||||||
runHook() {
|
runHook() {
|
||||||
local hookName="$1"
|
local hookName="$1"
|
||||||
if test "$(type -t $hookName)" = function; then
|
case "$(type -t $hookName)" in
|
||||||
$hookName
|
(function|alias|builtin) $hookName;;
|
||||||
else
|
(file) source $hookName;;
|
||||||
eval "${!hookName}"
|
(keyword) :;;
|
||||||
fi
|
(*) eval "${!hookName}";;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user