Skip non-git folders in groovy module commands
skips engine modules such as Core or BiomesAPI
skips non-module folders, such as .settings
skips modules in local development not under version control
@@ -8,6 +8,7 @@ import groovy.json.JsonSlurper
import org.ajoberstar.grgit.Grgit
import org.ajoberstar.grgit.exception.GrgitException
import org.ajoberstar.grgit.Remote
+import org.eclipse.jgit.errors.RepositoryNotFoundException
class common {
@@ -190,6 +191,7 @@ class common {
println "$itemType \"$itemName\" not found"
return
}
+ try {
def itemGit = Grgit.open(dir: targetDir)
// Do a check for the default remote before we attempt to update
@@ -216,6 +218,9 @@ class common {
} catch (GrgitException exception) {
println "Unable to update $itemName, Skipping: ${exception.getMessage()}"
}
+ } catch(RepositoryNotFoundException exception) {
+ println "Skipping update for $itemName: no repository found (probably engine module)"
+ }
}
/**
