Skip to content

Commit a607b2b

Browse files
author
Quentin Rossetti
authored
Merge pull request #115 from jliben/fix-spawn-options
fix: spawn options are processed
2 parents 018df71 + 9ae7a28 commit a607b2b

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
18+
- run: npm ci
19+
- run: npm test
20+
21+
publish-gpr:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
packages: write
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: actions/setup-node@v2
30+
with:
31+
node-version: 16
32+
registry-url: https://npm.pkg.github.com/
33+
- run: npm ci
34+
- run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"repository": {
1717
"type": "git",
18-
"url": "https://github.com/quentinrossetti/node-7z.git"
18+
"url": "https://github.com/jliben/node-7z.git"
1919
},
2020
"keywords": [
2121
"node",
@@ -27,7 +27,9 @@
2727
"wrapper"
2828
],
2929
"author": "Quentin Rossetti <quentin.rossetti@gmail.com>",
30-
"contributors": [],
30+
"contributors": [
31+
{"name": "Jessé LIBEN", "email": "jliben@gmail.com"}
32+
],
3133
"license": "ISC",
3234
"bugs": {
3335
"url": "https://github.com/quentinrossetti/node-7zip/issues"

src/lifecycle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const createFactory = ({
5151
seven._dataType = Parser.fetch(options._command, 'dataType')
5252
seven._matchInfos = Parser.matchInfos
5353
seven._matchProgress = Parser.matchProgress
54+
seven._spawnOptions = options.$spawnOptions
5455
seven.info = new Map()
5556
debug('lifecycle: create %O', options)
5657
return seven

test/unit/lifecycle.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ describe('Unit: lifecycle.js', function () {
4545
expect(sevenFake._stage).to.eql(STAGE_HEADERS)
4646
})
4747

48+
it('should handle $spawnOptions', function () {
49+
const create = Seven.createFactory({
50+
Bin: binFromOptionsFake,
51+
Flags: flagsFromOptionsFake,
52+
Parser: parserFake,
53+
Args: argsFromOptionsFake
54+
})
55+
const sevenFake = create({
56+
$spawnOptions: {
57+
background: false
58+
}
59+
})
60+
expect(sevenFake._spawnOptions.background).to.eql(false)
61+
})
62+
4863
it('should set _isProgressFlag when specified', function () {
4964
const create = Seven.createFactory({
5065
Bin: binFromOptionsFake,

0 commit comments

Comments
 (0)