"use strict";

const { app } = require("electron");
const util = require("util");
const {
  values: { version = false },
} = util.parseArgs({
  options: {
    version: {
      type: "boolean",
    },
  },
  args: process.argv.slice(app.isPackaged ? 1 : 2),
  strict: false,
});
if (version) {
  console.log(`${app.getName()} v${app.getVersion()}`);
  app.exit(0);
}
const gotTheLock = app.requestSingleInstanceLock({
  argv: process.argv.slice(app.isPackaged ? 1 : 2),
});
if (!gotTheLock) {
  app.quit();
} else {
  require("./MainInstanceEntryPoint.js");
}
