本文整理匯總了TypeScript中rimraf類的典型用法代碼示例。如果您正苦於以下問題:TypeScript rimraf類的具體用法?TypeScript rimraf怎麽用?TypeScript rimraf使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了rimraf類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: rimraf
program.command('clean <folder>').action(function(folder) {
const pathToRemove = path.join(ROOT, folder);
rimraf(pathToRemove, () => {
console.log(`removed: ${pathToRemove}`);
});
});
示例2: Promise
return new Promise(resolve => {
rimraf(dirPath,{glob: false,maxBusyTries: 10},(e)=>{
if (e) {
console.error('Failed to delete Dir: ', dirPath);
}
resolve({});
});
})
示例3: Promise
return new Promise((resolve) => {
rimraf(file, () => {
// if (error) {
// return reject(error);
// }
resolve(file);
});
});
示例4: Promise
return new Promise((res, rej) => {
rimraf(storageDir, err => {
if (err) return rej(err)
console.info('%s deleted.', storageDir)
return res()
})
})
示例5: Promise
return new Promise((resolve, reject) => {
rimraf(filepath, options, (err) => {
if (err) {
return reject(err);
}
resolve();
});
});
示例6: Promise
return new Promise((resolve, reject) => {
rimraf(filePattern, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
示例7: Promise
return new Promise((resolve, reject) => {
rimraf(glob, err => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
示例8: rimraf
return new Promise<void>((resolve, reject) => {
rimraf(dirpath, err => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
示例9: uninstallSystem
function uninstallSystem(systemFolderName: string) {
rimraf(`${utils.systemsPath}/${systemFolderName}`, (err) => {
if (err != null) {
utils.emitError(`Failed to uninstalled system.`);
} else {
console.log("System successfully uninstalled.");
process.exit(0);
}
});
}
示例10: uninstallSystem
function uninstallSystem(systemFolderName: string) {
console.log(`Uninstalling system ${systemId}...`);
rimraf(`${systemsPath}/${systemFolderName}`, (err) => {
if (err != null) {
console.error(`Failed to uninstalled system.`);
process.exit(1);
} else {
console.log("System successfully uninstalled.");
}
});
}