Skip to content

Commit

Permalink
content parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Jul 27, 2024
1 parent b9219b7 commit dd36934
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Actions/CheckForUpdates/CheckForUpdates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ else {
}
}
Write-Host "Update $($_.DstFile)"
$_.Content | Set-ContentLF -Path $_.DstFile
Set-ContentLF -Path $_.DstFile -Content $_.Content
}
if ($releaseNotes -eq "") {
$releaseNotes = "No release notes available!"
Expand Down
2 changes: 1 addition & 1 deletion Actions/CheckForUpdates/yamlclass.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Yaml {

# Save the Yaml file with LF line endings using UTF8 encoding
Save([string] $filename) {
$this.content | Set-ContentLF -Path $filename
Set-ContentLF -Path $filename -Content $this.content
}

# Find the lines for the specified Yaml path, given by $line
Expand Down
2 changes: 1 addition & 1 deletion Actions/CreateApp/AppHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function UpdateALFile
$al = $al.Replace("$_", $startId)
$startId++
}
$al | Set-ContentLF -Path (Join-Path $destinationFolder $alFileName)
Set-ContentLF -Path (Join-Path $destinationFolder $alFileName) -Content $al
}

<#
Expand Down
9 changes: 6 additions & 3 deletions Actions/Github-Helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -715,12 +715,15 @@ function Set-ContentLF {
Process {
$path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($path)
if ($content -is [array]) {
$content = $content -join "`n"
Write-Host "array"
$contentStr = $content -join "`n"
Write-Host $contentStr
}
else {
$content = "$content".Replace("`r", "")
Write-Host "String"
$contentStr = "$content".Replace("`r", "")
}
[System.IO.File]::WriteAllText($path, "$content`n")
[System.IO.File]::WriteAllText($path, "$contentStr`n")
}
}

Expand Down
2 changes: 1 addition & 1 deletion e2eTests/e2eTestHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function CreateNewAppInFolder {
$folder = Join-Path $folder $name
New-Item -Path $folder -ItemType Directory | Out-Null
$appJson | Set-JsonContentLF -Path (Join-Path $folder "app.json")
$al -join "`n" | Set-ContentLF -Path (Join-Path $folder "$name.al")
Set-ContentLF -Path (Join-Path $folder "$name.al") -Content $al
$id
}

Expand Down

0 comments on commit dd36934

Please sign in to comment.