Hook scripts must end in .sh, FreeBSD packaging

- Only hook scripts that end in .sh are executed.
- When packaging for FreeBSD, batch-viz.sh and visualizations.sh are
  installed with a .sample extension. Addresses #137
This commit is contained in:
Reynir Björnsson 2022-08-26 18:23:23 +02:00
parent ac8c31f2ac
commit 7a9949fc5e
2 changed files with 3 additions and 3 deletions

View file

@ -450,7 +450,7 @@ let add_build
let rec go () = let rec go () =
let next_file = Unix.readdir dh in let next_file = Unix.readdir dh in
let file = Fpath.(dir / next_file) in let file = Fpath.(dir / next_file) in
if is_executable file then if is_executable file && Fpath.has_ext ".sh" file then
ignore (Sys.command (Fpath.to_string file ^ " " ^ args ^ " &")); ignore (Sys.command (Fpath.to_string file ^ " " ^ args ^ " &"));
go () go ()
in in

View file

@ -35,8 +35,8 @@ install -U "$bdir/builder-migrations" "$sbindir/builder-migrations"
install -U "$bdir/builder-db" "$sbindir/builder-db" install -U "$bdir/builder-db" "$sbindir/builder-db"
# stage visualization scripts # stage visualization scripts
install -U "$basedir/packaging/batch-viz.sh" "$confdir/batch-viz.sh" install -U "$basedir/packaging/batch-viz.sh" "$confdir/batch-viz.sh.sample"
install -U "$basedir/packaging/visualizations.sh" "$confdir/upload-hooks/visualizations.sh" install -U "$basedir/packaging/visualizations.sh" "$confdir/upload-hooks/visualizations.sh.sample"
# example repo scripts # example repo scripts
install -U "$basedir/packaging/dpkg-repo.sh" "$sharedir/dpkg-repo.sh" install -U "$basedir/packaging/dpkg-repo.sh" "$sharedir/dpkg-repo.sh"