Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ada88bb

Browse files
authored
Merge pull request #1133 from chrisgrieser/dev
fix: do not overwrite user-provided shellcheck `--shell` (#1064)
2 parents 179a285 + 5164c63 commit ada88bb

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

‎server/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Bash Language Server
22

3+
## 5.4.3
4+
5+
- Do not overwrite user-provided shellcheck `--shell` argument https://github.com/bash-lsp/bash-language-server/pull/1133
6+
37
## 5.4.2
48

59
- Fix wrong pnpm engine version

‎server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A language server for Bash",
44
"author": "Mads Hartmann",
55
"license": "MIT",
6-
"version": "5.4.2",
6+
"version": "5.4.3",
77
"main": "./out/server.js",
88
"typings": "./out/server.d.ts",
99
"bin": {

‎server/src/shellcheck/index.ts‎

Lines changed: 7 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /