index.js 1.3 KB

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