mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
9 lines
477 B
JavaScript
9 lines
477 B
JavaScript
// If not set, set the process title to an abridged version of the command that was used to start the process
|
|
|
|
function escapeBashString(str) {
|
|
return str.replace(/'/g, "'\\''");
|
|
}
|
|
|
|
const shortenedCommand = `node ${process.argv.slice(1).map(a => escapeBashString(a)).join(' ')}`;
|
|
process.title = `[stack-auth:${process.env.NEXT_PUBLIC_STACK_PORT_PREFIX || 81}xx] ${process.title || shortenedCommand.length > 200 ? shortenedCommand.slice(0, 200) + '...' : shortenedCommand}`;
|