From 371076b38eee5dab95c564b001442557936b5874 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 28 Feb 2022 12:52:34 -0600 Subject: [PATCH] fix: tmpdir structure --- packages/docker/src/start-container.js | 2 +- packages/repl/src/repl.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docker/src/start-container.js b/packages/docker/src/start-container.js index 0684cdb..8b1ce78 100644 --- a/packages/docker/src/start-container.js +++ b/packages/docker/src/start-container.js @@ -46,7 +46,7 @@ export default async (flecks, key, config) => { ...Object.entries(config.ports) .map(([host, container]) => ['-p', `${host}:${container}`]).flat(), ]; - const datadir = join(tmpdir(), 'flecks', id, key, 'docker'); + const datadir = join(tmpdir(), 'flecks', id, 'docker', key); debug("creating datadir '%s'", datadir); try { await mkdir(datadir, {recursive: true}); diff --git a/packages/repl/src/repl.js b/packages/repl/src/repl.js index f5c6133..be6c429 100644 --- a/packages/repl/src/repl.js +++ b/packages/repl/src/repl.js @@ -52,14 +52,14 @@ export async function createReplServer(flecks) { }); }); try { - await mkdir(join(tmpdir(), 'flecks', 'repl')); + await mkdir(join(tmpdir(), 'flecks', id, 'repl')); } catch (error) { if ('EEXIST' !== error.code) { throw error; } } - const socket = join(tmpdir(), 'flecks', 'repl', `${id}-${Date.now()}.sock`); + const socket = join(tmpdir(), 'flecks', id, 'repl', `${id}-${Date.now()}.sock`); flecks.set('$flecks/repl.socket', socket); await new Promise((resolve) => netServer.listen(socket, resolve)); debug('listening @ %s', socket);