本文整理汇总了TypeScript中gulp-util.log函数的典型用法代码示例。如果您正苦于以下问题:TypeScript log函数的具体用法?TypeScript log怎么用?TypeScript log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: checkFolderExists
/*
* Check which folders exists based on the file path
*/
checkFolderExists (folderName: string) {
let getFolderUrl = util.format("/_api/web/GetFolderByServerRelativeUrl(@FolderName)?@FolderName='%s'", encodeURIComponent(folderName));
let header = {
headers: {
"Accept": "application/json;odata=verbose",
"content-type":"application/json;odata=verbose",
"X-RequestDigest": this.digest
},
json: true
};
let endPoint = this.config.site + getFolderUrl;
if(this.config.verbose){
gutil.log("INFO: Checking folder exists " + endPoint);
}
return new Promise<any>((resolve, reject) => {
this.spr.get(endPoint, header)
.then(success => {
if(this.config.verbose) {
gutil.log('INFO: Folder ' + folderName + ' exists');
}
// Temp cache the processed folder
this.cacheLocation(folderName);
resolve(success);
})
.catch(err => {
gutil.log("INFO: Folder '" + folderName + "' doesn't exist and will be created");
resolve(err);
}
);
});
}
开发者ID:estruyf,项目名称:gulp-spsync-creds,代码行数:35,代码来源:folderCreator.ts
示例2: webpack
webpack(webpackConfig, (err, stats) => {
if (err) {
throw new gutil.PluginError('webpack', err)
}
watch ? null : gutil.log(gutil.colors.cyan('[webpack]', stats.toString()))
callback ? callback(resolve) : resolve()
})
开发者ID:jianxc,项目名称:teambition-mobile-web,代码行数:7,代码来源:bundle.ts
示例3: modifyFile
export = (done: any) => {
// Note: dirty hack until we're able to set config easier
modifyFile(join(Config.TMP_DIR, 'tsconfig.json'), (content: string) => {
const parsed = JSON.parse(content);
const path = join(
Config.PROJECT_ROOT,
Config.TOOLS_DIR,
'manual_typings',
'project'
);
parsed.files = parsed.files || [];
parsed.files = parsed.files.concat(
readdirSync(path)
.filter(f => f.endsWith('d.ts'))
.map(f => join(path, f))
);
parsed.files = parsed.files.filter(
(f: string, i: number) => parsed.files.indexOf(f) === i
);
parsed.files.push(join(Config.BOOTSTRAP_DIR, 'main.ts'));
return JSON.stringify(parsed, null, 2);
});
const args = argv as any;
// If a translation, tell the compiler
if (args.lang) {
let i18nFilePath = `${Config.LOCALE_DEST}/messages.${args.lang}.xlf`;
let isExists = existsSync(i18nFilePath);
if (isExists) {
args['i18nFile'] = i18nFilePath;
args['locale'] = args.lang;
args['i18nFormat'] = 'xlf';
} else {
util.log(util.colors.gray('Translation file is not found'), util.colors.yellow(i18nFilePath));
util.log(util.colors.gray(`Use 'npm run i18n' command to create your translation file`));
}
}
const cliOptions = new NgcCliOptions(args);
main(Config.TMP_DIR, cliOptions, codegen)
.then(done)
.catch(e => {
console.error(e.stack);
console.error('Compilation failed');
process.exit(1);
});
};
开发者ID:baleboy,项目名称:zephyrjs-ide,代码行数:47,代码来源:compile.ahead.prod.ts
示例4:
.then(res => {
// Temp cache the processed folder
this.cacheLocation(pathArray[0]);
if (this.config.verbose) {
gutil.log('INFO: Folder created:', pathArray[0]);
}
return this.createPathRecursive(pathArray.slice(1, pathArray.length), deferred);
})
开发者ID:estruyf,项目名称:gulp-spsync-creds,代码行数:8,代码来源:folderCreator.ts
示例5: resolve
.then(success => {
if(this.config.verbose) {
gutil.log('INFO: Folder ' + folderName + ' exists');
}
// Temp cache the processed folder
this.cacheLocation(folderName);
resolve(success);
})
开发者ID:estruyf,项目名称:gulp-spsync-creds,代码行数:8,代码来源:folderCreator.ts
示例6: existsSync
.forEach((key: string) => {
if (key === 'lang') {
const lang: string = namedArgs[key] as string;
const i18nFilePath = `${Config.LOCALE_DEST}/messages.${lang}.xlf`;
const isExists = existsSync(i18nFilePath);
if (isExists) {
args.push('--i18nFile', i18nFilePath);
args.push('--locale', lang);
args.push('--i18nFormat', 'xlf');
} else {
util.log(util.colors.gray('Translation file is not found'), util.colors.yellow(i18nFilePath));
util.log(util.colors.gray(`Use 'npm run i18n' command to create your translation file`));
}
} else {
args.push('--' + key, namedArgs[key]);
}
});
开发者ID:NickyDo,项目名称:angular-seed-1,代码行数:17,代码来源:compile.ahead.prod.ts
示例7: buildHugo
buildHugo(err => {
if(err){
gutil.log(gutil.colors.red('[hugo] Error building hugo: ') + err)
browserSync.notify("Hugo build failed :(");
} else {
browserSync.reload();
}
})
开发者ID:gburgett,项目名称:blog,代码行数:8,代码来源:gulpfile.ts
示例8: reject
fs.remove(path, err => {
if (err) {
gutil.log('Error cleaning ', path, err.message, err.code, err.errno)
reject(err)
return
}
resolve()
})
开发者ID:gburgett,项目名称:blog,代码行数:8,代码来源:gulpfile.ts
示例9: cb
fs.remove('static/.640x/images', err => {
if (err) {
gutil.log('Error cleaning ', path, err.message, err.code, err.errno)
cb(err)
return
}
cb()
})
开发者ID:gburgett,项目名称:blog,代码行数:8,代码来源:image_tasks.ts
示例10: onStart
function onStart(): void {
if (count++ > 0) {
return;
}
startTime = new Date().getTime();
util.log(`Starting ${util.colors.green('compilation')}...`);
}
开发者ID:DonJayamanne,项目名称:vscode,代码行数:8,代码来源:reporter.ts
注:本文中的gulp-util.log函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论