title: How to re-use platform parameter when building an electron application using `electron-forge make --platform=win32`?
body: <p>We are building an electron desktop application for macos, linux, and windows.<br />
  Here is our electron-forge config:</p>
  <pre class="lang-js prettyprint-override"><code>// forge.config.js
  const os = require('os')
  
  const package = require('./package.json')
  
  function getExtraResource() {
    const p = os.platform()
    switch (p) {
      case 'darwin':
        return ['./static/bin/pasteld-mac']
      case 'linux':
        return ['./static/bin/pasteld-linux']
      case 'win32':
        return ['./static/bin/pasteld-win.exe']
      default:
        throw new Error(
          'forge.config.js error: your OS is not supported. Supported OS are: darwin, linux, win32',
        )
    }
  }
  
  function getIcon() {
    const p = os.platform()
    switch (p) {
      case 'darwin':
        return './static/icons/icon.icns'
      case 'linux':
        return './static/icons/icon.png'
      case 'win32':
        return './static/icons/icon.ico'
      default:
        throw new Error(
          'forge.config.js error: your OS is not supported. Supported OS are: darwin, linux, win32',
        )
    }
  }
  
  module.exports = {
    packagerConfig: {
      name: package.productName,
      executableName: package.name,
      icon: getIcon(),
      asar: true,
      extraResource: getExtraResource(),
      protocols: [
        {
          protocol: package.name,
          name: package.name,
          schemes: [package.protocolSchemes.native],
        },
      ],
    },
    makers: [
      {
        name: '@electron-forge/maker-squirrel',
        config: {
          exe: `${package.name}.exe`,
          setupIcon: './static/icons/icon.ico',
          loadingGif: './static/icons/icon.gif',
          iconUrl:
            'https://raw.githubusercontent.com/pastelnetwork/pastel-electron-wallet/master/static/icons/icon.ico',
          title: package.productName,
          setupExe: `${package.productName} Setup - v${package.version}.exe`,
          skipUpdateIcon: true,
        },
      },
      {
        name: '@electron-forge/maker-dmg',
        config: {
          icon: './static/icons/icon.icns',
          name: package.productName,
        },
      },
      {
        name: '@electron-forge/maker-deb',
        config: {
          options: {
            icon: './static/icons/icon.png',
          },
        },
      },
    ],
    plugins: [
      [
        '@electron-forge/plugin-webpack',
        {
          mainConfig: './webpack.main.config.js',
          renderer: {
            config: './webpack.renderer.config.js',
            entryPoints: [
              {
                html: './src/index.html',
                js: './src/renderer.tsx',
                name: 'main_window',
              },
            ],
          },
        },
      ],
    ],
  }
  </code></pre>
  <p>As you can see in the above file, <code>getExtraResource()</code> detects the os type and pick the right executable file based on it. In other words, running <code>run make</code> on a proper platform is all we need to build the application.<br />
  However, we are now going to build the windows installer on linux wine image, more specifically using <code>electronuserland/builder:wine-mono</code> image.
  Everything is working as expected so far, except one thing - we still need to add a step to the switch clause in the <code>getExtraResource()</code> to pick the windows executable in the builder image instead of linux executable(note that the builder image is still a linux image!).<br />
  It will be something like this:</p>
  <pre class="lang-js prettyprint-override"><code># forge.config.js
  //...
  
  function getExtraResource() {
    const p = os.platform()
    switch (p) {
      case 'darwin':
        return ['./static/bin/pasteld-mac']
      case 'linux':
        if (build_arg === 'win32') {
          return ['./static/bin/pasteld-win.exe']
        }
        return ['./static/bin/pasteld-linux']
      case 'win32':
        return ['./static/bin/pasteld-win.exe']
      default:
        throw new Error(
          'forge.config.js error: your OS is not supported. Supported OS are: darwin, linux, win32',
        )
    }
  }
  
  //...
  </code></pre>
  <p>How can I get the <code>build_arg</code> in the above file?<br />
  Build command is <code>yarn make --platform=win32</code> in the wine builder image.<br />
  Thanks in advance!</p>