Skip to content

Commit 2352dc9

Browse files
authored
Merge pull request #2347 from Pinata-Consulting/setup-file-off-sharp-corner
setup: avoid confusion when user is not up to date
2 parents c591fbd + 43c8dee commit 2352dc9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

setup.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,20 @@ if [ $EUID -ne 0 ]; then
1010
exit 1
1111
fi
1212

13-
if git submodule status --recursive | grep -q "^-"; then
14-
git submodule update --init --recursive
13+
tmpfile=$(mktemp)
14+
# any error messages from this command will stand out
15+
# more clearly when run as a separate command rather than
16+
# being piped
17+
git submodule status --recursive > "$tmpfile"
18+
19+
if grep -q "^-" "$tmpfile"; then
20+
sudo -u $SUDO_USER git submodule update --init --recursive
21+
elif grep -q "^+" "$tmpfile"; then
22+
# Make it easy for users who are not hacking ORFS to do the right thing,
23+
# run with current submodules, at the cost of having ORFS
24+
# hackers disable this test manually when hacking setup.sh
25+
echo "Submodules are not up to date, run 'git submodule update --recursive' and try again"
26+
exit 1
1527
fi
1628

1729
"$DIR/etc/DependencyInstaller.sh" -base

0 commit comments

Comments
 (0)