00checkStartup.js 734 B

1234567891011121314151617181920212223
  1. var fs = require('fs');
  2. let errors = [];
  3. if (!process.env.WRITABLE_PATH) {
  4. errors.push("WRITABLE_PATH environment variable missing and/or unset, please configure !");
  5. } else {
  6. try {
  7. fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
  8. } catch (err) {
  9. errors.push("can't write to " + process.env.WRITABLE_PATH, err);
  10. errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
  11. }
  12. }
  13. if (errors.length > 0) {
  14. console.error("\n\n");
  15. console.error(errors.join("\n"));
  16. console.error("\n");
  17. console.error("Stopping Wekan");
  18. console.error("Wekan isn't runnable. Please resolve the error's above and restart Wekan !");
  19. console.error("\n\n");
  20. process.exit(1);
  21. }