Skip to content

Node.js based forum software built for the modern web

fix: #10586, fix webinstaller folders

Barış Soner Uşaklı1928a186179e
diff --git a/install/web.js b/install/web.js
index d1609c45d3..0072d15003 100644
--- a/install/web.js
+++ b/install/web.js
@@ -58,7 +58,7 @@ web.install = async function (port) {
winston.info(`Launching web installer on port ${port}`);
app.use(express.static('public', {}));
- app.use('/assets', express.static(path.join(__dirname, '../build/webpack'), {}));
+ app.use('/assets', express.static(path.join(__dirname, '../build/public'), {}));
app.engine('tpl', (filepath, options, callback) => {
filepath = filepath.replace(/\.tpl$/, '.js');
@@ -206,15 +206,20 @@ async function launch(req, res) {
}
const filesToDelete = [
- 'installer.css',
- 'installer.min.js',
- 'bootstrap.min.css',
+ path.join(__dirname, '../public', 'installer.css'),
+ path.join(__dirname, '../public', 'bootstrap.min.css'),
+ path.join(__dirname, '../build/public', 'installer.min.js'),
];
- await Promise.all(
- filesToDelete.map(
- filename => fs.promises.unlink(path.join(__dirname, '../public', filename))
- )
- );
+ try {
+ await Promise.all(
+ filesToDelete.map(
+ filename => fs.promises.unlink(filename)
+ )
+ );
+ } catch (err) {
+ console.log(err.stack);
+ }
+
child.unref();
process.exit(0);
} catch (err) {
diff --git a/webpack.common.js b/webpack.common.js
index f4c2e5551a..7929a196d5 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -29,7 +29,8 @@ module.exports = {
publicPath: `${relativePath}/assets/`,
clean: {
keep(asset) {
- return !asset.endsWith('.min.js');
+ return asset === 'installer.min.js' ||
+ !asset.endsWith('.min.js');
},
},
},