Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Sass executable wrapper that forwards to the correct exe #313

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions bin/sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node

const child_process = require("child_process");
const {compilerCommand} = require("../dist/lib/src/compiler-path");

// TODO npm/cmd-shim#152 and yarnpkg/berry#6422 - If and when the package
// managers support it, we should make this a proper shell script rather than a
// JS wrapper.

try {
child_process.execFileSync(
compilerCommand[0], [...compilerCommand.slice(1), ...process.argv.slice(2)], {
stdio: 'inherit',
windowsHide: true
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent once?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made me realize there's not a great way to get this file covered by the linter/formatter as-is, so I converted it to TypeScript.

} catch (error) {
if (error.code) {
throw error;
} else {
process.exitCode = error.status;
}
}


1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"engines": {
"node": ">=16.0.0"
},
"bin": {"sass": "bin/sass"},
"scripts": {
"init": "ts-node ./tool/init.ts",
"check": "npm-run-all check:gts check:tsc",
Expand Down
Loading