Move over more parameter normalization
imlucas opened this issue · comments
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';
}