This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chdir to proc.env.PWD, that can be passed explicitly. fixes #231
- Loading branch information
1 parent
4a2055e
commit 939c0df
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
const path = require('path'); | ||
const assert = require('assert'); | ||
const utils = require('../utils.js'); | ||
|
||
assert(!module.parent); | ||
assert(__dirname === process.cwd()); | ||
|
||
const target = process.argv[2] || 'host'; | ||
const input = './test-x-index.js'; | ||
const output = './run-time/test-output.exe'; | ||
|
||
let right; | ||
|
||
utils.pkg.sync([ | ||
'--target', target, | ||
'--output', output, input | ||
], { env: { | ||
CHDIR: 'source', | ||
PATH: process.env.PATH | ||
} }); | ||
|
||
right = utils.spawn.sync( | ||
'./' + path.basename(output), [], | ||
{ cwd: path.dirname('source/' + output) } | ||
); | ||
|
||
assert.equal(right, 'ok\n'); | ||
utils.vacuum.sync(path.dirname('source/' + output)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
console.log('ok'); |