本文整理汇总了TypeScript中tildify.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript tildify.default方法的具体用法?TypeScript tildify.default怎么用?TypeScript tildify.default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tildify
的用法示例。
在下文中一共展示了tildify.default方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: registerTask
/**
* Registers the task by the given taskname and path.
* @param {string} taskname - The name of the task.
* @param {string} path - The path of the task.
*/
function registerTask(taskname: string, path: string): void {
const TASK = join(path, taskname);
util.log('Registering task', util.colors.yellow(tildify(TASK)));
gulp.task(taskname, (done: any) => {
const task = normalizeTask(require(TASK), TASK);
if (changeFileManager.pristine || task.shallRun(changeFileManager.lastChangedFiles)) {
return task.run(done);
} else {
done();
}
});
}
示例2: registerTask
function registerTask(taskname: string, path: string): void {
const TASK = join(path, taskname);
util.log('Registering task', chalk.yellow(tildify(TASK)));
gulp.task(taskname, (done: any) => {
const task = require(TASK);
if (task.length > 0) {
return task(done);
}
const taskReturnedValue = task();
if (isstream(taskReturnedValue)) {
return taskReturnedValue;
}
// TODO: add promise handling if needed at some point.
done();
});
}
示例3: registerTask
/**
* Registers the task by the given taskname and path.
* @param {string} taskname - The name of the task.
* @param {string} path - The path of the task.
*/
function registerTask(taskname: string, path: string): void {
const TASK = join(path, taskname);
util.log('Registering task', util.colors.yellow(tildify(TASK)));
gulp.task(taskname, (done: any) => {
const task = normalizeTask(require(TASK), TASK);
if (changeFileManager.pristine || task.shallRun(changeFileManager.lastChangedFiles)) {
const result = task.run(done, changeFileManager.lastChangedFiles);
if (result && typeof result.catch === 'function') {
result.catch((e: any) => {
util.log(`Error while running "${TASK}"`, e);
});
}
return result;
} else {
done();
}
});
}