mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-07 15:48:46 +01:00
Add JSDoc comments
This commit is contained in:
parent
f0bce909f6
commit
ef917ebe4e
25
server.js
25
server.js
@ -498,15 +498,14 @@ const setupTasks = async function () {
|
||||
await statsEndpoint.init();
|
||||
|
||||
const cleanupPlugins = await loadPlugins();
|
||||
|
||||
const BackUpTitle = process.title;
|
||||
const consoleTitle = process.title;
|
||||
|
||||
const exitProcess = async () => {
|
||||
statsEndpoint.onExit();
|
||||
if (typeof cleanupPlugins === 'function') {
|
||||
await cleanupPlugins();
|
||||
}
|
||||
setWindowTitle(BackUpTitle);
|
||||
setWindowTitle(consoleTitle);
|
||||
process.exit();
|
||||
};
|
||||
|
||||
@ -566,6 +565,19 @@ if (listen && !getConfigValue('whitelistMode', true) && !basicAuthMode) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the title of the terminal window
|
||||
* @param {string} title Desired title for the window
|
||||
*/
|
||||
function setWindowTitle(title) {
|
||||
if (process.platform === 'win32') {
|
||||
process.title = title;
|
||||
}
|
||||
else {
|
||||
process.stdout.write(`\x1b]2;${title}\x1b\x5c`);
|
||||
}
|
||||
}
|
||||
|
||||
if (cliArguments.ssl) {
|
||||
https.createServer(
|
||||
{
|
||||
@ -592,10 +604,3 @@ function ensurePublicDirectoriesExist() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setWindowTitle(title) {
|
||||
if (process.platform == 'win32')
|
||||
process.title = title
|
||||
else
|
||||
process.stdout.write('\x1b]2;' + title + '\x1b\x5c')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user