index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*************************************************
  2. ** preload为预加载模块,该文件将会在程序启动时加载 **
  3. *************************************************/
  4. const ChildJob = require('ee-core/module/jobs/child');
  5. const UtilsPs = require('ee-core/module/utils/ps');
  6. const Log = require('ee-core/module/log');
  7. const test = require('./test');
  8. /**
  9. * 预加载模块入口
  10. * @param {Object} app - 全局app对象
  11. */
  12. module.exports = async (app) => {
  13. //已实现的功能模块,可选择性使用和修改
  14. const trayAddon = app.addon.tray;
  15. const securityAddon = app.addon.security;
  16. const awakenAddon = app.addon.awaken;
  17. const autoUpdaterAddon = app.addon.autoUpdater;
  18. trayAddon.create();
  19. securityAddon.create();
  20. awakenAddon.create();
  21. autoUpdaterAddon.create();
  22. Log.info("[main] process type: ", UtilsPs.processType());
  23. Log.info("[main] process cwd: ", process.cwd());
  24. test();
  25. let myJob = new ChildJob();
  26. //myJob.run('exampleJob', './jobs/example.js');
  27. myJob.run('exampleJob', './jobs/hello.js');
  28. // let opt2 = {
  29. // dev: true,
  30. // type: 'child', // renderer
  31. // path: './jobs/example.js',
  32. // winOptions: {
  33. // show: true
  34. // },
  35. // childOptions: {}
  36. // }
  37. // let myJob2 = new OriginJob();
  38. // myJob2.create('exampleJob2', opt2);
  39. }