git ssb

0+

cel-desktop / ssb-pkg



Tree: cfc8d49135488f7554210234b3a503c2dbd6c6a5

Files: cfc8d49135488f7554210234b3a503c2dbd6c6a5 / test / test-50-odd-entrypoint / main.js

878 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const path = require('path');
6const assert = require('assert');
7const utils = require('../utils.js');
8
9assert(!module.parent);
10assert(__dirname === process.cwd());
11
12const target = process.argv[2] || 'host';
13const windows = process.platform === 'win32';
14let input = './test-x-index.js';
15const output = './run-time/test-output.exe';
16
17if (windows) {
18 input = path.resolve(input).toLowerCase();
19} else {
20 // did not manage to find odd one for unix
21}
22
23let left, right;
24utils.mkdirp.sync(path.dirname(output));
25
26left = utils.spawn.sync(
27 'node', [ path.basename(input) ],
28 { cwd: path.dirname(input) }
29);
30
31utils.pkg.sync([
32 '--target', target,
33 '--output', output, input
34]);
35
36right = utils.spawn.sync(
37 './' + path.basename(output), [],
38 { cwd: path.dirname(output) }
39);
40
41assert.equal(left, right);
42utils.vacuum.sync(path.dirname(output));
43

Built with git-ssb-web