src/main/javascript/Installer/buildStrategies.js
function customStrategy(projectDir, builder, cb)
{
  const dest = builder.getTargetDestination(projectDir);
  shelljs.rm('-rf', dest);

  const copyOptions = { overwrite: true, expand: true, dot: true };

  const onCustomInstallerFilesReady = function (err) {
    builder.buildFromSource(dest, projectDir);
    cb();
  };

  const onInstallerFilesReady = function (err) {
    if (err) {
      cb(err);
      return;
    }

    let customInstallerSrc = path.resolve(projectDir, "src", "installer");
    customInstallerSrc = fs.realpathSync(customInstallerSrc);

    const customInstallerTarget = path.resolve(dest, "src", "settings");
    copy(customInstallerSrc, customInstallerTarget, copyOptions, onCustomInstallerFilesReady);
  };

  let installerDir = path.resolve(projectDir, "node_modules", "@deskpro", INSTALLER_PACKAGE_NAME);
  installerDir = fs.realpathSync(installerDir);
  copy(installerDir, dest, copyOptions, onInstallerFilesReady);
}
function customStrategy(projectDir, builder, cb)
{
  const dest = builder.getTargetDestination(projectDir);
  shelljs.rm('-rf', dest);

  const copyOptions = { overwrite: true, expand: true, dot: true };

  const onCustomInstallerFilesReady = function (err) {
    builder.buildFromSource(dest, projectDir);
    cb();
  };

  const onInstallerFilesReady = function (err) {
    if (err) {
      cb(err);
      return;
    }

    let customInstallerSrc = path.resolve(projectDir, "src", "installer");
    customInstallerSrc = fs.realpathSync(customInstallerSrc);

    const customInstallerTarget = path.resolve(dest, "src", "settings");
    copy(customInstallerSrc, customInstallerTarget, copyOptions, onCustomInstallerFilesReady);
  };

  let installerDir = path.resolve(projectDir, "node_modules", "@deskpro", INSTALLER_PACKAGE_NAME);
  installerDir = fs.realpathSync(installerDir);
  copy(installerDir, dest, copyOptions, onInstallerFilesReady);
}
function customStrategy ( projectDir , builder , cb ) { const dest = builder . getTargetDestination ( projectDir ) ; shelljs . rm ( '-rf' , dest ) ; const copyOptions = { overwrite : true , expand : true , dot : true } ; const onCustomInstallerFilesReady = function ( err ) { builder . buildFromSource ( dest , projectDir ) ; cb ( ) ; } ; const onInstallerFilesReady = function ( err ) { if ( err ) { cb ( err ) ; return ; } let customInstallerSrc = path . resolve ( projectDir , "src" , "installer" ) ; customInstallerSrc = fs . realpathSync ( customInstallerSrc ) ; const customInstallerTarget = path . resolve ( dest , "src" , "settings" ) ; copy ( customInstallerSrc , customInstallerTarget , copyOptions , onCustomInstallerFilesReady ) ; } ; let installerDir = path . resolve ( projectDir , "node_modules" , "@deskpro" , INSTALLER_PACKAGE_NAME ) ; installerDir = fs . realpathSync ( installerDir ) ; copy ( installerDir , dest , copyOptions , onInstallerFilesReady ) ; }
Builds the installer under the app's own target folder

@param {String} projectDir
@param {InstallerBuilder} builder
@param {Function} cb
Builds the installer under the app s own target folder