Skip to content

Commit

Permalink
Fix getting linter version of npm plugin. (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam authored Dec 3, 2021
1 parent 8762288 commit bd57165
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Note: Can be used with `megalinter/megalinter@beta` in your GitHub Action mega-l
- Correct some broken links in `README` from "Mega-Linter" to "MegaLinter" (#1030)
- Docker run -- clean-up containers when exits (#1033)
- Add missing Bandit config file and rules path options (#679)
- Fix getting linter version of npm plugin. (#845)

- Linters
- New linter `phplint` to speed-up linting of php files (#1031)
Expand Down
3 changes: 2 additions & 1 deletion megalinter/Linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,10 @@ def get_linter_version(self):
def get_linter_version_output(self):
command = self.build_version_command()
logging.debug("Linter version command: " + str(command))
cwd = os.getcwd() if command[0] != "npm" else "~/"
try:
process = subprocess.run(
command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd
)
return_code = process.returncode
output = utils.decode_utf8(process.stdout)
Expand Down

0 comments on commit bd57165

Please sign in to comment.