text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
      value: true
  });
  exports.PkgTarget = undefined;
  
  var _bluebirdLstC;
  
  function _load_bluebirdLstC() {
      return _bluebirdLstC = require("bluebird-lst-c");
  }
  
  exports.prepareProductBuildArgs = prepareProductBuildArgs;
  
  var _electronBuilderUtil;
  
  function _load_electronBuilderUtil() {
      return _electronBuilderUtil = require("electron-builder-util");
  }
  
  var _path = _interopRequireWildcard(require("path"));
  
  var _electronBuilderCore;
  
  function _load_electronBuilderCore() {
      return _electronBuilderCore = require("electron-builder-core");
  }
  
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  
  class PkgTarget extends (_electronBuilderCore || _load_electronBuilderCore()).Target {
      constructor(packager) {
          super("pkg");
          this.packager = packager;
      }
      build(appOutDir, arch) {
          var _this = this;
  
          return (0, (_bluebirdLstC || _load_bluebirdLstC()).coroutine)(function* () {
              const packager = _this.packager;
              const appInfo = packager.appInfo;
              const outFile = _path.join(appOutDir, `${appInfo.productFilename}-${appInfo.version}.pkg`);
              const keychainName = (yield packager.codeSigningInfo).keychainName;
              const args = prepareProductBuildArgs(_path.join(appOutDir, `${appInfo.productFilename}.app`), (yield packager.findInstallerIdentity(false, keychainName)), keychainName);
              args.push("--version", appInfo.buildVersion);
              args.push(outFile);
              yield (0, (_electronBuilderUtil || _load_electronBuilderUtil()).exec)("productbuild", args);
              packager.dispatchArtifactCreated(outFile, _this, `${appInfo.name}-${appInfo.version}.pkg`);
          })();
      }
  }
  exports.PkgTarget = PkgTarget;
  function prepareProductBuildArgs(appPath, identity, keychain) {
      const args = ["--component", appPath, "/Applications", "--sign", identity];
      if (keychain != null) {
          args.push("--keychain", keychain);
      }
      return args;
  }
  //# sourceMappingURL=pkg.js.map