function runCmd (cwd, argv) {
	const scripts = argv._.slice(1)

	const pkgJson = readFile(path.join(cwd, 'package.json'), 'utf8')
		::map(JSON.parse)

	// if no script(s) have been specified, log out the available scripts.
	if (!scripts.length) {
		return pkgJson::_do(logAvailable)
	}

	const PATH = [path.join(cwd, 'node_modules/.bin'), process.env.PATH]
		.join(path.delimiter)
	const env = {...process.env, PATH}
	const runOptions = {env, stdio: 'inherit'}

	return pkgJson::map(({scripts = {}}) => scripts)::entries() // eslint-disable-line no-shadow
		::filter(([name]) => ~scripts.indexOf(name))
		::concatMap(([name, script]) => run(script, runOptions)
			::map((code) => ([name, script, code])))
		::_do(logCode)
		::reduce((codes, [name, script, code]) => codes + code, 0)
		::_do((code) => assert.equal(code, 0, 'exit status != 0'))
}
run a `package.json` script and the related pre- and postscript.
@param {String} cwd - current working directory.
@param  {Object} argv - command line arguments.
@return {Observable} - observable sequence.