mirror of
https://github.com/openstf/stf
synced 2025-10-03 09:49:17 +02:00
33 lines
915 B
JavaScript
33 lines
915 B
JavaScript
module.exports.command = 'storage-temp'
|
|
|
|
module.exports.describe = 'Start a temp storage unit.'
|
|
|
|
module.exports.builder = function(yargs) {
|
|
var os = require('os')
|
|
|
|
return yargs
|
|
.env('STF_STORAGE_TEMP')
|
|
.strict()
|
|
.option('port', {
|
|
alias: 'p'
|
|
, describe: 'The port to bind to.'
|
|
, type: 'number'
|
|
, default: process.env.PORT || 7100
|
|
})
|
|
.option('save-dir', {
|
|
describe: 'The location where files are saved to.'
|
|
, type: 'string'
|
|
, default: os.tmpdir()
|
|
})
|
|
.epilog('Each option can be be overwritten with an environment variable ' +
|
|
'by converting the option to uppercase, replacing dashes with ' +
|
|
'underscores and prefixing it with `STF_STORAGE_TEMP_` (e.g. ' +
|
|
'`STF_STORAGE_TEMP_SAVE_DIR`).')
|
|
}
|
|
|
|
module.exports.handler = function(argv) {
|
|
return require('../../units/storage/temp')({
|
|
port: argv.port
|
|
, saveDir: argv.saveDir
|
|
})
|
|
}
|