Skip to content

Commit ea8cef3

Browse files
committed
fix: do not overwrite user-provided shellcheck --shell (#1064)
1 parent b42d877 commit ea8cef3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: server/src/shellcheck/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,19 @@ export class Linter {
120120
.map((folderName) => `--source-path=${folderName}`)
121121

122122
const args = [
123-
`--shell=${shellName}`,
124123
'--format=json1',
125124
'--external-sources',
126125
...sourcePathsArgs,
127126
...additionalArgs,
128127
]
129128

129+
// only add `--shell` argument if non is provided by the user in their
130+
// config. This allows to the user to override the shell. See #1064.
131+
const userArgs = additionalArgs.join(' ')
132+
if (!(userArgs.includes('--shell') || userArgs.includes('-s '))) {
133+
args.unshift(`--shell=${shellName}`)
134+
}
135+
130136
logger.debug(`ShellCheck: running "${this.executablePath} ${args.join(' ')}"`)
131137

132138
let out = ''

0 commit comments

Comments
 (0)