本文整理匯總了TypeScript中tildify類的典型用法代碼示例。如果您正苦於以下問題:TypeScript tildify類的具體用法?TypeScript tildify怎麽用?TypeScript tildify使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了tildify類的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();
}
});
}