You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/04/04 07:52:44 UTC

[GitHub] [sling-org-apache-sling-jcr-repoinit] bdelacretaz commented on a diff in pull request #23: SLING-8843 repoinit developer mode

bdelacretaz commented on code in PR #23:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/23#discussion_r841457200


##########
src/main/java/org/apache/sling/jcr/repoinit/impl/RepositoryInitializerFactory.java:
##########
@@ -99,43 +107,50 @@ public String toString() {
 
     @Override
     public void processRepository(final SlingRepository repo) throws Exception {
-        if ( (config.references() != null && config.references().length > 0)
-           || (config.scripts() != null && config.scripts().length > 0 )) {
+        // loginAdministrative is ok here, definitely an admin operation
+        final Session s = repo.loginAdministrative(null);
+        try {
+            executeScripts(s, config);
+        } catch (Exception e) {
+            if (continueOnError()) {
+                log.error("Repoinit error, won't stop execution because {} is set to non-true. Without this "

Review Comment:
   "set to non-true" takes more mental bandwidth than "false" or "set to false", IMHO ;-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org