git ssb

0+

cel-desktop / ssb-pkg



Tree: 67c0e15a98a66eb99db2251478505d6f3d37535c

Files: 67c0e15a98a66eb99db2251478505d6f3d37535c / test / test-50-spawn / test-cpfork-b-child.js

608 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5var assert = require('assert');
6var cluster = require('cluster');
7
8assert(process.send);
9assert(!cluster.worker);
10
11console.log('Hello from cpfork-b-child!');
12console.log('Args', JSON.stringify(process.argv.slice(2)));
13
14process.on('message', function (value) {
15 if (value === 128) process.exit();
16 process.send(value * 2);
17});
18
19var fs = require('fs');
20
21try {
22 // must patch fs even if entrypoint is not in snapshot
23 console.log(fs.readFileSync('dirty-hack-for-testing-purposes'));
24} catch (error) {
25 if (!process.pkg) console.log('dirty-hack-for-testing-purposes');
26}
27

Built with git-ssb-web