本文整理汇总了TypeScript中del.sync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript sync函数的具体用法?TypeScript sync怎么用?TypeScript sync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sync函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: close
public close(): void {
if (this.configurationDirPath && fs.existsSync(this.configurationDirPath)) {
del.sync(this.configurationDirPath, {force: true});
}
if (this.certsDir && fs.existsSync(this.certsDir)) {
del.sync(this.certsDir);
}
}
示例2: cleanSync
function cleanSync(deleteVsix: boolean) {
del.sync('install.*');
del.sync('.omnisharp*');
del.sync('.debugger');
if (deleteVsix) {
del.sync('*.vsix');
}
}
示例3: close
public close(multipleLoginSupported?: boolean, command?: string): void {
if (multipleLoginSupported) {
if (this.isLogoutRequired(command)) {
this.logout();
}
}
else {
if (this.configurationDirPath && fs.existsSync(this.configurationDirPath)) {
del.sync(this.configurationDirPath, {force: true});
}
if (this.certsDir && fs.existsSync(this.certsDir)) {
del.sync(this.certsDir);
}
}
}
示例4: loadResourceFile
.map(path => {
const styleContent = loadResourceFile(path);
if (deleteResource === true) {
del.sync(path);
}
return styleContent;
});
示例5: unsetDockerConfigEnvVariable
public unsetDockerConfigEnvVariable() {
var dockerConfigPath = tl.getVariable("DOCKER_CONFIG");
if (dockerConfigPath) {
tl.setVariable("DOCKER_CONFIG", "");
del.sync(dockerConfigPath, {force: true});
}
}
示例6: removeConfigDirAndUnsetEnvVariable
private removeConfigDirAndUnsetEnvVariable(): void {
let dockerConfigDirPath = tl.getVariable("DOCKER_CONFIG");
if (dockerConfigDirPath && this.isPathInTempDirectory(dockerConfigDirPath) && fs.existsSync(dockerConfigDirPath)) {
tl.debug(tl.loc('DeletingDockerConfigDirectory', dockerConfigDirPath));
del.sync(dockerConfigDirPath, {force: true});
}
this.unsetEnvironmentVariable();
}
示例7: getPackageJSON
gulp.task('vsix:release:unpackage', () => {
const packageJSON = getPackageJSON();
const name = packageJSON.name;
const version = packageJSON.version;
const packageName = `${name}-${version}.vsix`;
del.sync(unpackedVsixPath);
fs.createReadStream(packageName).pipe(unzip.Extract({ path: unpackedVsixPath }));
});
示例8: callback
callback(file, (done: () => void) => {
try {
del.sync(dir, { force: true });
console.log(`delete ${dir}`);
done();
} catch (error) {
console.error(error);
}
});
示例9: join
return fileContent.replace(/templateUrl:\s*'([^']+?\.html)'/g, (_match, templateUrl) => {
const templatePath = join(dirname(filePath), templateUrl);
const templateContent = loadResourceFile(templatePath);
if (deleteResource === true) {
del.sync(templatePath);
}
return `template: "${templateContent}"`;
});
示例10: Promise
.then( () => {
const p = util.root(util.currentPackage().tsConfigObj.compilerOptions.outDir);
del.sync(p);
const tsConfig = jsonfile.readFileSync(util.root(util.FS_REF.TS_CONFIG_TMP));
tsConfig.compilerOptions.target = 'es5';
jsonfile.writeFileSync(util.root(util.FS_REF.TS_CONFIG_TMP), tsConfig, {spaces: 2});
return new Promise( (resolve, reject) => webpack(config).run((err, stats) => err ? reject(err) : resolve(stats)) );
})