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 StaticServer = require('./static-server.js');
|
||||||
const SSLStaticServer = require('./static-sslserver.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 = () => {
|
const init = () => {
|
||||||
StaticServer.run('7000');
|
StaticServer.run('7000');
|
||||||
SSLStaticServer.run('8000');
|
SSLStaticServer.run('8000');
|
||||||
|
|||||||
Reference in New Issue
Block a user