git ssb

0+

cel-desktop / ssb-pkg



Tree: 67c0e15a98a66eb99db2251478505d6f3d37535c

Files: 67c0e15a98a66eb99db2251478505d6f3d37535c / test / test-50-symlink / main.js

771 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const fs = require('fs');
6const path = require('path');
7const assert = require('assert');
8const utils = require('../utils.js');
9
10assert(!module.parent);
11assert(__dirname === process.cwd());
12
13// test symlinks on unix only // TODO junction
14if (process.platform === 'win32') return;
15
16const target = process.argv[2] || 'host';
17const input = './test-x-index.js';
18const output = './test-output.exe';
19const symlink = './test-symlink.exe';
20
21let right;
22
23utils.pkg.sync([
24 '--target', target,
25 '--output', output, input
26]);
27
28fs.symlinkSync(output, symlink);
29
30right = utils.spawn.sync(
31 './' + path.basename(symlink), [],
32 { cwd: path.dirname(symlink) }
33);
34
35assert.equal(right, '42\n');
36utils.vacuum.sync(output);
37utils.vacuum.sync(symlink);
38

Built with git-ssb-web