Skip to content

Commit

Permalink
Fix escaping of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-akram committed Feb 23, 2025
1 parent 367d1d5 commit ccbc325
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20, 21 ]
node-version: [ 18, 20, 22 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -31,5 +31,4 @@ jobs:
- name: "Fetch & Unpack Allure Commandline from Maven Central"
run: powershell -ExecutionPolicy Bypass -File fetch-source.ps1
if: runner.os == 'Windows'
- run: npm link
- run: allure --version
- run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dist
allure-commandline.tgz
allure-report

#IDEA Files
.idea/*
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env node
var path = require('path');
var isWindows = path.sep === '\\';
var allureCommand = 'allure' + (isWindows ? '.bat' : '');

/**
*
* @param {string[]} args
*/
module.exports = function(args) {
return require('child_process').spawn(path.join(__dirname, 'dist/bin', allureCommand), args, {
return require('batspawn').spawn(path.join(__dirname, 'dist/bin', 'allure'), '.bat', args, {
env: process.env,
stdio: 'inherit',
shell: true,
});
}
16 changes: 12 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"index.js"
],
"scripts": {
"test": "node ./bin/allure --version"
"test": "node ./bin/allure generate -c --single-file --name \"Web & Mobile\""
},
"repository": "https://github.com/allure-framework/allure-npm.git",
"license": "Apache-2.0",
"devDependencies": {}
"dependencies": {
"batspawn": "^1.0.1"
}
}

0 comments on commit ccbc325

Please sign in to comment.