mirror of
https://github.com/zoriya/flood.git
synced 2025-12-18 05:05:17 +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 crypto = require('crypto');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const os = require('os');
|
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')}`);
|
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 rTorrentSession = path.join(temporaryRuntimeDirectory, '.session');
|
||||||
const rTorrentSocket = path.join(temporaryRuntimeDirectory, 'rtorrent.sock');
|
const rTorrentSocket = path.join(temporaryRuntimeDirectory, 'rtorrent.sock');
|
||||||
|
|
||||||
@@ -55,6 +58,10 @@ const closeProcesses = () => {
|
|||||||
|
|
||||||
startFlood();
|
startFlood();
|
||||||
|
|
||||||
|
process.on('SIGINT', () => {
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
|
||||||
process.on('exit', () => {
|
process.on('exit', () => {
|
||||||
closeProcesses();
|
closeProcesses();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user