fix(ci): normalize shell validation input (fixes #3)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
function normalizeRelativePosixPath(value) {
|
||||
@@ -19,11 +20,14 @@ function bashSyntaxCheckInvocation(root, scriptPath = 'examples/server/forgeflow
|
||||
if (typeof root !== 'string' || !root.trim()) {
|
||||
throw new Error('Project root is required for shell validation.');
|
||||
}
|
||||
const relativeScriptPath = normalizeRelativePosixPath(scriptPath);
|
||||
const scriptText = fs.readFileSync(path.join(root, ...relativeScriptPath.split('/')), 'utf8');
|
||||
return {
|
||||
command: 'bash',
|
||||
args: ['-n', normalizeRelativePosixPath(scriptPath)],
|
||||
args: ['-n'],
|
||||
options: {
|
||||
cwd: root,
|
||||
input: scriptText.replace(/\r\n?/g, '\n'),
|
||||
encoding: 'utf8',
|
||||
windowsHide: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user