From a7c6abc6fee79641d45b452fe6217deaa1bd0973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Thu, 7 Nov 2024 11:01:40 +0000 Subject: [PATCH 1/4] chore: replace travis with github workflows --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++++ .travis.yml | 12 ------------ README.md | 11 +++-------- 3 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..ca38416 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,25 @@ +name: CI + +on: [push] + +jobs: + unit: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['18', '20', '22'] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - run: npm ci + + - run: npm run lint + + - run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6ba1865..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -arch: - - amd64 - - ppc64le -language: node_js -node_js: - - 8 - - 9 - - 10 - - 12 -after_success: - - 'npm i codecov' - - 'node_modules/.bin/codecov' diff --git a/README.md b/README.md index c4a4da8..5f286ba 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,19 @@ # cross-spawn -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [npm-url]:https://npmjs.org/package/cross-spawn [downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg [npm-image]:https://img.shields.io/npm/v/cross-spawn.svg -[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn -[travis-image]:https://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg +[ci-url]:https://github.com/moxystudio/cross-spawn/actions/workflows/ci.yaml +[ci-image]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml/badge.svg [appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn [appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg [codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn [codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg -[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn -[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg -[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev -[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg A cross platform solution to node's spawn and spawnSync. - ## Installation Node.js version 8 and up: From bff0c87c8b627c4e6d04ec2449e733048bebb464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Thu, 7 Nov 2024 11:08:59 +0000 Subject: [PATCH 2/4] chore: remove codecov --- .github/workflows/ci.yaml | 3 +-- README.md | 4 +--- appveyor.yml | 11 +++-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ca38416..b9636bf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,8 +13,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} diff --git a/README.md b/README.md index 5f286ba..d26a4a6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # cross-spawn -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url] [npm-url]:https://npmjs.org/package/cross-spawn [downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg @@ -9,8 +9,6 @@ [ci-image]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml/badge.svg [appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn [appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg -[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn -[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg A cross platform solution to node's spawn and spawnSync. diff --git a/appveyor.yml b/appveyor.yml index 77acd10..51ec227 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,10 +6,9 @@ init: environment: matrix: - - nodejs_version: 8 - - nodejs_version: 9 - - nodejs_version: 10 - - nodejs_version: 12 + - nodejs_version: 18 + - nodejs_version: 20 + - nodejs_version: 22 install: - ps: Install-Product node $env:nodejs_version @@ -26,7 +25,3 @@ test_script: - node --version - npm --version - cmd: npm test --no-color - -after_test: - - "npm i codecov" - - "node_modules/.bin/codecov" From 640d391fde65388548601d95abedccc12943374f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Thu, 7 Nov 2024 12:50:38 +0000 Subject: [PATCH 3/4] fix: fix escaping bug introduced by backtracking --- lib/util/escape.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util/escape.js b/lib/util/escape.js index e4804b9..7bf2905 100644 --- a/lib/util/escape.js +++ b/lib/util/escape.js @@ -20,12 +20,12 @@ function escapeArgument(arg, doubleEscapeMetaChars) { // Sequence of backslashes followed by a double quote: // double up all the backslashes and escape the double quote - arg = arg.replace(/(?=\\*?)"/g, '$1$1\\"'); + arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"'); // Sequence of backslashes followed by the end of the string // (which will become a double quote later): // double up all the backslashes - arg = arg.replace(/(?=\\*?)$/, '$1$1'); + arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1'); // All other backslashes occur literally From 085268352dcbcad8064c64c5efb25268b4023184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Thu, 7 Nov 2024 13:00:01 +0000 Subject: [PATCH 4/4] chore(release): 7.0.5 --- CHANGELOG.md | 7 +++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b46e4a..e987a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [7.0.5](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.4...v7.0.5) (2024-11-07) + + +### Bug Fixes + +* fix escaping bug introduced by backtracking ([640d391](https://github.com/moxystudio/node-cross-spawn/commit/640d391fde65388548601d95abedccc12943374f)) + ### [7.0.4](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.4) (2024-11-07) diff --git a/package-lock.json b/package-lock.json index b680b35..c456a5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cross-spawn", - "version": "7.0.4", + "version": "7.0.5", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 50ebcb9..857e4d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cross-spawn", - "version": "7.0.4", + "version": "7.0.5", "description": "Cross platform child_process#spawn and child_process#spawnSync", "keywords": [ "spawn",