githelper.git/
githelper.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2020-03-21
2020-03-21 15:08:47 by Henrik Grubbström (Grubba) <grubba@grubba.org>
108e9b23daf75ba00435bc623bc680eaba56beb5 (
10
lines) (+
8
/-
2
)
[
Show
|
Annotate
]
Branch:
master
Install the githelper-plugins symlink.
22:
"pre-receive" : PreReceiveHook, "post-commit" : PostCommitHook, "post-rewrite" : PostRewriteHook,
+
"githelper-plugins" : 0,
]); mapping(string:program) filters = ([
918:
if (!mkdir(hooksdir)) iofail("Failed to create %s", hooksdir); }
-
foreach (hooks; string name; ) {
+
foreach (hooks; string name;
program p
) {
string path = combine_path(hooksdir, name);
-
+
string src = p?__FILE__:combine_path(__DIR__, name);
+
if (!file_stat(src)) {
+
iofail("Source file %s not found");
+
}
Stdio.Stat s = file_stat(path, 1); if (!s) { write("Installing %s\n", path);
-
System.symlink(
__FILE__
, path);
+
System.symlink(
src
, path);
} else if (s->islnk) { /* Already setup ok, it seems */ } else {