Update: static-server中增加移除nwjs cache功能
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
const fs = require('fs').promises
|
||||
const StaticServer = require('./static-server.js');
|
||||
const SSLStaticServer = require('./static-sslserver.js');
|
||||
|
||||
async function deleteDirectory(dirPath) {
|
||||
try {
|
||||
await fs.rm(dirPath, { recursive: true, force: true });
|
||||
console.log('Directory deleted successfully.');
|
||||
} catch (err) {
|
||||
console.error('Error deleting directory:', err);
|
||||
}
|
||||
}
|
||||
|
||||
deleteDirectory('./nw_cache');
|
||||
|
||||
const init = () => {
|
||||
StaticServer.run('7000');
|
||||
SSLStaticServer.run('8000');
|
||||
@@ -10,4 +22,4 @@ if (!module.parent) {
|
||||
init();
|
||||
} else {
|
||||
module.exports = init;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user