fix: tmpdir structure

This commit is contained in:
cha0s 2022-02-28 12:52:34 -06:00
parent 6ad2abd18c
commit 371076b38e
2 changed files with 3 additions and 3 deletions

View File

@ -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});

View File

@ -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);