process-argv.js 436 B

1234567891011121314151617
  1. function getProcessArgvBinIndex() {
  2. if (isBundledElectronApp())
  3. return 0;
  4. return 1;
  5. }
  6. function isBundledElectronApp() {
  7. return isElectronApp() && !process.defaultApp;
  8. }
  9. function isElectronApp() {
  10. return !!process.versions.electron;
  11. }
  12. export function hideBin(argv) {
  13. return argv.slice(getProcessArgvBinIndex() + 1);
  14. }
  15. export function getProcessArgvBin() {
  16. return process.argv[getProcessArgvBinIndex()];
  17. }