Urucas / electron-packager-interactive

An interactive implementation of electron-packager
MIT License
202 stars 32 forks source link

It's possible to not select a platform or arch #6

Closed adam-lynch closed 8 years ago

adam-lynch commented 8 years ago

If I hit enter to select a platform and then arch, I get the following:

epi
? Overwrite output directory ? Yes
? Use asar source packaging ? No
? Select Electron app source directory: /Users/adam/Code/GitHub/electron-quick-start
? Select Electron app output directory: /Users/adam/Code/GitHub/electron-quick-start/releases
? Select Application name: electron-quick-start
? Select App Bundle Id (optional): 
? Select App Version(optional): 0.0.1
? Select Electron icon file: 
? Select Electron version release: 0.34.1
? Select platforms: 
? Select architecture: 
Electron packager settings:
{ dir: '/Users/adam/Code/GitHub/electron-quick-start',
  name: 'electron-quick-start',
  platform: '',
  arch: '',
  version: '0.34.1',
  out: '/Users/adam/Code/GitHub/electron-quick-start/releases',
  'app-bundle-id': '',
  'app-version': '',
  overwrite: true,
  asar: false,
  icon: '',
  app_version: '0.0.1',
  bundle_id: '',
  appname: 'electron-quick-start',
  sourcedir: '/Users/adam/Code/GitHub/electron-quick-start',
  ignore: '/Users/adam/Code/GitHub/electron-quick-start/releases' }

✗ Error: Must specify arch

If I press space to check a selection then enter to move on to the next question, it works.

Latest version, on a Mac.

vrunoa commented 8 years ago

When hitting enter on Inquirer, it goes to the next question without selecting any platform or arch.Perhaps, the best solution would be to select a platform and arch by default. I'm thinking, maybe, use the current platform, arch where you're running epi

adam-lynch commented 8 years ago

@vrunoa it's definitely possible to have inquirer not do that. I've done it myself.

adam-lynch commented 8 years ago

Just checked... you use checkbox, that should be list. I can sort it in a PR?

vrunoa commented 8 years ago

@adam-lynch PR's are welcome.

vrunoa commented 8 years ago

@adam-lynch exactly. Maybe some user just want to build for windows and mac avoiding linux, or any combination that just includes 2 platforms. Setting the input to a list type would remove this flow from the module. I believe the best solution for this case would be set the user platform(arch) as default. Also add a validation, throw an error when platform or arch os not selected. Let me know if you would like to implement this, otherwise I'll add this implementation.

vrunoa commented 8 years ago

@adam-lynch I decided that if a user doesnt select an arch or a platform, it will ask again.

ivanornes commented 8 years ago

I also had this issue and as a workaround, the lines that specify the platform and architecture in the dist/index.js file can be modified like:

    options.arch = "x64";
    if (options.arch == "") {
      error("Error: Must specify arch");
    }
    options.platform = "darwin"
    if (options.platform == "") {
      error("Error: Must specify platform");
    }