Skip to content

Commit

Permalink
Make the init script a portable POSIX shell script
Browse files Browse the repository at this point in the history
This translates init-tests-after-clone.sh from bash to POSIX sh,
changing the hashbang and replacing all bash-specific features, so
that it can be run on any POSIX-compatible ("Bourne style") shell,
including but not limited to bash. This allows it to be used even
on systems that don't have any version of bash installed anywhere.

Only that script is modified. The other shell scripts make greater
use of (and gain greater benefit from) bash features, and are also
only used for building and releasing. In contrast, this script is
meant to be used by most users who clone the repository.
  • Loading branch information
EliahKagan committed Oct 3, 2023
1 parent e604b46 commit 19dfbd8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions init-tests-after-clone.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/env bash
#!/bin/sh

set -e

if [[ -z "$TRAVIS" ]]; then
read -rp "This operation will destroy locally modified files. Continue ? [N/y]: " answer
if [[ ! $answer =~ [yY] ]]; then
exit 2
fi
if test -z "$TRAVIS"; then
printf 'This operation will destroy locally modified files. Continue ? [N/y]: ' >&2
read -r answer
case "$answer" in
[yY])
;;
*)
exit 2 ;;
esac
fi

git tag __testing_point__
Expand Down

0 comments on commit 19dfbd8

Please sign in to comment.