Skip to content

Commit

Permalink
chore: patch script package to use cross-spawn
Browse files Browse the repository at this point in the history
Link to PR with this commit:
testdouble/scripty#100
  • Loading branch information
Dwlad90 committed Jan 21, 2025
1 parent ed3f0cc commit 5689781
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ jobs:
exit 1
fi
sleep 780; # Wait for 13 minutes before checking the status
SLEEP_BASE=$((60*13))
echo "Sleeping for $((SLEEP_BASE/60)) minutes before checking the status"
sleep $SLEEP_BASE # Wait before checking the status
while true; do
status=$(gh run view "$run_id" --json status --jq '.status')
Expand Down
2 changes: 1 addition & 1 deletion crates/stylex-rs-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"format:toml:check": "taplo format --check",
"lint": "oxlint .",
"lint:check": " cargo clippy --all-targets --all-features -- -D warnings",
"postbuild:disable": "pnpm run check:artifacts",
"postbuild": "pnpm run check:artifacts",
"prepublishOnly": "napi prepublish --skip-gh-release",
"test": "ava",
"version": "napi version"
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
"lexical-core@<1.0.0": "^1.0.0",
"lexical@<=6.1.1": "^6.1.1",
"@farmfe/runtime@<=0.12.8": "^0.12.10"
},
"patchedDependencies": {
"scripty@2.1.1": "patches/scripty@2.1.1.patch"
}
}
}
40 changes: 40 additions & 0 deletions patches/scripty@2.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/lib/run/spawn-script.js b/lib/run/spawn-script.js
index b05fcb8dea26b0612e3db90506f0df7460e9cf33..3222ec591ea96bb7c7ed5536c6451fb0e79a934f 100644
--- a/lib/run/spawn-script.js
+++ b/lib/run/spawn-script.js
@@ -1,15 +1,19 @@
var _ = require('lodash')
var printScript = require('./print-script')
-var spawn = require('child_process').spawn
+var spawn = require('cross-spawn').spawn

module.exports = function (scriptFile, options, cb) {
printScript(scriptFile)

const child = spawn(scriptFile, options.userArgs, options.spawn)

- child.on('close', code => cb(code !== 0
- ? new Error(`script failed: '${scriptFile}'\nexit status: ${code}`)
- : null, code)
+ child.on('close', (code) =>
+ cb(
+ code !== 0
+ ? new Error(`script failed: '${scriptFile}'\nexit status: ${code}`)
+ : null,
+ code
+ )
)

_.invoke(options, 'spawn.tap', child)
diff --git a/package.json b/package.json
index fddbdf9ab092d3d2f898485bb74627a181878e4b..6d960822724e1526f10cf182ad9dd3d954dad649 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"dependencies": {
"async": "^2.6.4",
"glob": "^7.0.3",
+ "cross-spawn": "^7.0.6",
"lodash": "^4.17.11",
"resolve-pkg": "^1.0.0"
},
9 changes: 7 additions & 2 deletions pnpm-lock.yaml

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

0 comments on commit 5689781

Please sign in to comment.