mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
* 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 New Issue
Block a user