Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Move over more parameter normalization #4

@imlucas

Description

@imlucas

https://github.com/imlucas/version.mongodb.parts/blob/bb78c8ccd7533b7bb5b55d51431aae0ea2797fbd/lib/index.js#L19-L36

Some systems do weird things that would require extra logic in download scripts (eg '64bit' and 'Windows' in python). Make it easier for everyone so it just lives here.

req.locals = {
    opts: {
      branch: req.param('branch', 'master'),
      platform: req.param('platform', 'linux').toLowerCase(),
      bits: req.param('bits', '64').replace(/[^0-9]/g, ''),
      version: req.param('version'),
      debug: req.param('debug'),
      distro: req.param('distro')
    }
  };

  if(req.locals.opts.platform === 'darwin'){
    req.locals.opts.platform = 'osx';
  }
  if(req.locals.opts.platform === 'windows'){
    req.locals.opts.platform = 'win32';
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions