()
| 92 | } |
| 93 | |
| 94 | @Override |
| 95 | public int run() throws Exception { |
| 96 | final SiteInit init = createSiteInit(); |
| 97 | if (beforeInit(init)) { |
| 98 | return 0; |
| 99 | } |
| 100 | |
| 101 | init.flags.autoStart = getAutoStart() && init.site.isNew; |
| 102 | init.flags.dev = isDev() && init.site.isNew; |
| 103 | init.flags.skipPlugins = skipPlugins(); |
| 104 | init.flags.deleteCaches = getDeleteCaches(); |
| 105 | init.flags.isNew = init.site.isNew; |
| 106 | |
| 107 | final SiteRun run; |
| 108 | try { |
| 109 | init.initializer.run(); |
| 110 | init.flags.deleteOnFailure = false; |
| 111 | |
| 112 | Injector sysInjector = createSysInjector(init); |
| 113 | run = createSiteRun(init); |
| 114 | try { |
| 115 | run.upgradeSchema(); |
| 116 | } catch (StorageException e) { |
| 117 | String msg = "Couldn't upgrade schema. Expected if slave and read-only database"; |
| 118 | System.err.println(msg); |
| 119 | logger.atSevere().withCause(e).log("%s", msg); |
| 120 | } |
| 121 | |
| 122 | init.initializer.postRun(sysInjector); |
| 123 | } catch (Exception | Error failure) { |
| 124 | if (init.flags.deleteOnFailure) { |
| 125 | recursiveDelete(getSitePath()); |
| 126 | } |
| 127 | throw failure; |
| 128 | } |
| 129 | |
| 130 | System.err.println("Initialized " + getSitePath().toRealPath().normalize()); |
| 131 | afterInit(run); |
| 132 | return 0; |
| 133 | } |
| 134 | |
| 135 | protected boolean skipPlugins() { |
| 136 | return false; |
nothing calls this directly
no test coverage detected