0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/test/e2e-cli/utils/registry.ts
Juan Picado be2f6129bb
feat: clipanion as cli (#2160)
* feat: clipanion as cli

* chore: add version command

* chore: update ts
2021-04-03 13:13:31 +02:00

21 lines
686 B
TypeScript

import { fork } from 'child_process';
export function prepareEnvironment(rootFolder: string, folderName: string) {}
export function spawnRegistry(verdaccioPath: string, args: string[], childOptions) {
return new Promise((resolve, reject) => {
let _childOptions = { silent: true, ...childOptions };
const childFork = fork(verdaccioPath, args, _childOptions);
childFork.on('message', (msg: {verdaccio_started: boolean}) => {
if (msg.verdaccio_started) {
resolve(childFork);
}
});
childFork.on('error', (err) => reject([err]));
childFork.on('disconnect', (err) => reject([err]));
childFork.on('exit', (err) => reject([err]));
});
}