fix: respect options
This commit is contained in:
parent
8ae2f59e19
commit
86d088a98e
|
@ -131,28 +131,29 @@ export async function startServer({
|
||||||
if (beforeBuild) {
|
if (beforeBuild) {
|
||||||
await beforeBuild({path, task});
|
await beforeBuild({path, task});
|
||||||
}
|
}
|
||||||
|
const spawnOptions = {
|
||||||
|
stdio: 'pipe',
|
||||||
|
...opts,
|
||||||
|
env: {
|
||||||
|
DEBUG_COLORS: 'dumb' !== TERM,
|
||||||
|
FLECKS_ENV__flecks_server__stats: '{"preset": "none"}',
|
||||||
|
FLECKS_ENV__flecks_server__start: true,
|
||||||
|
FLECKS_CORE_ROOT: path,
|
||||||
|
FLECKS_SERVER_TEST_SOCKET: socketPath,
|
||||||
|
FORCE_COLOR: 'dumb' !== TERM,
|
||||||
|
NODE_ENV: 'test',
|
||||||
|
NODE_PATH: join(FLECKS_CORE_ROOT, '..', '..', 'node_modules'),
|
||||||
|
...opts.env,
|
||||||
|
},
|
||||||
|
};
|
||||||
const server = spawnWith(
|
const server = spawnWith(
|
||||||
[await binaryPath('flecks', '@flecks/build'), 'build', ...args],
|
[await binaryPath('flecks', '@flecks/build'), 'build', ...args],
|
||||||
{
|
spawnOptions,
|
||||||
stdio: 'pipe',
|
|
||||||
...opts,
|
|
||||||
env: {
|
|
||||||
DEBUG_COLORS: 'dumb' !== TERM,
|
|
||||||
FLECKS_ENV__flecks_server__stats: '{"preset": "none"}',
|
|
||||||
FLECKS_ENV__flecks_server__start: true,
|
|
||||||
FLECKS_CORE_ROOT: path,
|
|
||||||
FLECKS_SERVER_TEST_SOCKET: socketPath,
|
|
||||||
FORCE_COLOR: 'dumb' !== TERM,
|
|
||||||
NODE_ENV: 'test',
|
|
||||||
NODE_PATH: join(FLECKS_CORE_ROOT, '..', '..', 'node_modules'),
|
|
||||||
...opts.env,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
server.on('exit', async () => {
|
server.on('exit', async () => {
|
||||||
socketServer.close();
|
socketServer.close();
|
||||||
});
|
});
|
||||||
if (failOnErrorCode) {
|
if (failOnErrorCode && 'pipe' === spawnOptions.stdio) {
|
||||||
const stdio = pipesink(server.stderr.pipe(server.stdout.pipe(new PassThrough())));
|
const stdio = pipesink(server.stderr.pipe(server.stdout.pipe(new PassThrough())));
|
||||||
server.on('exit', async (code) => {
|
server.on('exit', async (code) => {
|
||||||
if (!server.done && 0 !== code) {
|
if (!server.done && 0 !== code) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user