當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript tildify類代碼示例

本文整理匯總了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();
    }
  });
}
開發者ID:CNSKnight,項目名稱:angular2-seed-advanced,代碼行數:19,代碼來源:tasks_tools.ts

示例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();
  });
}
開發者ID:AriFreyr,項目名稱:EveApp,代碼行數:20,代碼來源:tasks_tools.ts

示例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();
    }
  });
}
開發者ID:NickyDo,項目名稱:angular-seed-1,代碼行數:25,代碼來源:tasks_tools.ts


注:本文中的tildify類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。