本文整理匯總了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)) );
})