Skip to content
Permalink
Browse files

Only do submodule sync/update when needed.

  • Loading branch information...
vrurg committed Apr 8, 2019
1 parent abe7d5a commit 38980f0db78206c3c8727432042823120007878d
Showing with 14 additions and 9 deletions.
  1. +1 −1 3rdparty/nqp-configure
  2. +13 −8 Configure.pl
@@ -11,14 +11,19 @@
use Data::Dumper;

BEGIN {
print "Updating nqp-configure submodule...\n";
my $msg = qx{git submodule sync --quiet 3rdparty/nqp-configure && git submodule --quiet update --init 3rdparty/nqp-configure 2>&1};
if ($? >> 8 == 0) { print "OK\n" }
else {
if ($msg =~ /[']([^']+)[']\s+already exists and is not an empty/) {
print "\n===SORRY=== ERROR: Cannot update submodule because directory exists and is not empty.\n" .
">>> Please delete the following folder and try again:\n$1\n\n";
exit 1;
unless ( -e '3rdparty/nqp-configure/LICENSE' ) {
print "Updating nqp-configure submodule...\n";
my $msg =
qx{git submodule sync --quiet 3rdparty/nqp-configure && git submodule --quiet update --init 3rdparty/nqp-configure 2>&1};
if ( $? >> 8 == 0 ) { print "OK\n" }
else {
if ( $msg =~ /[']([^']+)[']\s+already exists and is not an empty/ )
{
print "\n===SORRY=== ERROR: "
. "Cannot update submodule because directory exists and is not empty.\n"
. ">>> Please delete the following folder and try again:\n$1\n\n";
exit 1;
}
}
}
}

0 comments on commit 38980f0

Please sign in to comment.
You can’t perform that action at this time.