Skip to content

Commit

Permalink
Move variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bdovaz committed Jan 10, 2023
1 parent ba2e214 commit b531448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions megalinter/linters/PowershellLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def build_lint_command(self, file=None):
if self.linter_name == "powershell":
pwsh_script[0] += f" -Path '{file}'"
elif self.linter_name == "powershell_formatter":
file_encoding = config.get("POWERSHELL_POWERSHELL_FORMATTER_OUTPUT_ENCODING", "utf8")

pwsh_script[0] += f" -ScriptDefinition (Get-Content -Path '{file}' -Raw)"

if (self.apply_fixes is True):
file_encoding = config.get("POWERSHELL_POWERSHELL_FORMATTER_OUTPUT_ENCODING", "utf8")

pwsh_script[0] += f" | Out-File '{file}' -Encoding {file_encoding} -NoNewline"

if (
Expand Down

0 comments on commit b531448

Please sign in to comment.