本文整理汇总了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;
}
},