mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
testsetup: print out temporary runtime directory at start
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const chalk = require('chalk');
|
||||
const crypto = require('crypto');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
@@ -6,6 +7,8 @@ const {spawn} = require('child_process');
|
||||
|
||||
const temporaryRuntimeDirectory = path.resolve(os.tmpdir(), `flood.test.${crypto.randomBytes(12).toString('hex')}`);
|
||||
|
||||
console.log(chalk.cyan(`Temporary runtime directory: ${temporaryRuntimeDirectory}\n`));
|
||||
|
||||
const rTorrentSession = path.join(temporaryRuntimeDirectory, '.session');
|
||||
const rTorrentSocket = path.join(temporaryRuntimeDirectory, 'rtorrent.sock');
|
||||
|
||||
@@ -55,6 +58,10 @@ const closeProcesses = () => {
|
||||
|
||||
startFlood();
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
process.exit();
|
||||
});
|
||||
|
||||
process.on('exit', () => {
|
||||
closeProcesses();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user