Skip to content

Commit

Permalink
Merge pull request #2347 from Pinata-Consulting/setup-file-off-sharp-…
Browse files Browse the repository at this point in the history
…corner

setup: avoid confusion when user is not up to date
  • Loading branch information
maliberty authored Sep 13, 2024
2 parents c591fbd + 43c8dee commit 2352dc9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,20 @@ if [ $EUID -ne 0 ]; then
exit 1
fi

if git submodule status --recursive | grep -q "^-"; then
git submodule update --init --recursive
tmpfile=$(mktemp)
# any error messages from this command will stand out
# more clearly when run as a separate command rather than
# being piped
git submodule status --recursive > "$tmpfile"

if grep -q "^-" "$tmpfile"; then
sudo -u $SUDO_USER git submodule update --init --recursive
elif grep -q "^+" "$tmpfile"; then
# Make it easy for users who are not hacking ORFS to do the right thing,
# run with current submodules, at the cost of having ORFS
# hackers disable this test manually when hacking setup.sh
echo "Submodules are not up to date, run 'git submodule update --recursive' and try again"
exit 1
fi

"$DIR/etc/DependencyInstaller.sh" -base
Expand Down

0 comments on commit 2352dc9

Please sign in to comment.