本文整理匯總了TypeScript中execa.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: execa
skipOnWindows(plugin, async () => {
const cwd = path.join(__dirname, '../../tmp/plugin', plugin)
await fs.remove(cwd)
const pkg = await readPkg(path.join(__dirname, '../../node_modules', plugin, 'package.json'))
await execa('git', ['clone', pkg.repository.url.split('+')[1], cwd])
const opts = {cwd, stdio: [0, 1, 2]}
await execa('git', ['checkout', `v${pkg.version}`], opts)
await execa('yarn', [], opts)
await execa('yarn', ['test'], opts)
})
示例2: main
async function main() {
for (const zoom of range(minzoom, maxzoom + 1)) {
const mbtilesZoom = `${name}-z${zoom}.mbtiles`
const args = [
'--output=' + mbtilesZoom,
'--force',
'--minimum-zoom=' + zoom,
'--maximum-zoom=' + zoom,
'--full-detail=' + (16 - zoom + 16),
'--no-line-simplification',
'--no-feature-limit',
'--no-tile-size-limit',
'--no-polygon-splitting',
'--no-clipping',
'--no-duplication',
name + ext
]
if (verbose) { console.log('Args', args) }
if (verbose) { console.log('Starting zoom', zoom) }
await execa('tippecanoe', args)
if (verbose) { console.log('Finished zoom', zoom) }
await execa.shell(`sqlite3 ${mbtilesZoom} .dump >> ${name}.dump`)
if (verbose) { console.log('Dumped', mbtilesZoom) }
await execa.shell(`rm ${mbtilesZoom}`)
if (verbose) { console.log('Removed', mbtilesZoom) }
}
// Clean
await execa.shell(`sqlite3 ${name}.mbtiles < ${name}.dump`)
if (verbose) { console.log('Merge dump') }
await execa.shell(`rm -f ${name}.dump`)
if (verbose) { console.log('Removed dump') }
console.log('All Done! :)')
}
示例3: LintFailure
task: () =>
execa('tslint', [...process.argv.slice(2), '--project', project.tsConfigPath], {
cwd: project.directory,
env: chalk.enabled ? { FORCE_COLOR: 'true' } : {},
stdio: ['ignore', 'pipe', 'pipe'],
}).catch(error => {
throw new LintFailure(project, error);
}),
示例4: execa
useSpinner<void>(`Saving version ${version} to package.json`, async () => {
changeCwdToGrafanaUi();
await execa('npm', ['version', version]);
changeCwdToGrafanaUiDist();
const pkg = require(`${process.cwd()}/package.json`);
pkg.version = version;
await savePackage({ path: `${process.cwd()}/package.json`, pkg });
})();
示例5: ProjectFailure
task: () =>
execa(cmd, getArgs(project), {
cwd: project.directory,
env: chalk.enabled ? { FORCE_COLOR: 'true' } : {},
stdio: ['ignore', 'pipe', 'pipe'],
}).catch(error => {
throw new ProjectFailure(project, error);
}),
示例6: async
getRoot: async (cwd: Path): Promise<Path | null | undefined> => {
try {
const result = await execa('hg', ['root'], {cwd, env});
return result.stdout;
} catch (e) {
return null;
}
},
示例7: execa
getRoot: async cwd => {
try {
const result = await execa('hg', ['root'], {cwd, env});
return result.stdout;
} catch (e) {
return null;
}
},
示例8: async
const findChangedFilesUsingCommand = async (
args: Array<string>,
cwd: Config.Path,
): Promise<Array<Config.Path>> => {
const result = await execa('git', args, {cwd});
return result.stdout
.split('\n')
.filter(s => s !== '')
.map(changedPath => path.resolve(cwd, changedPath));
};
示例9: execa
getRoot: async cwd => {
const options = ['rev-parse', '--show-cdup'];
try {
const result = await execa('git', options, {cwd});
return path.resolve(cwd, result.stdout);
} catch (e) {
return null;
}
},