Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .expeditor/build_gems.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ Write-Output "`r"


Write-Output "--- :muscle: cleanup, cleanup, everybody, everywhere: Deleting existing DLL's in the chef-powershell Directory and copying the newly compiled ones down"
$x64_bin_path = $("$project_root\chef-powershell\bin\ruby_bin_folder\AMD64")
$arch = if ($env:PROCESSOR_ARCHITECTURE) { $env:PROCESSOR_ARCHITECTURE } else { "AMD64" }
$x64_bin_path = $("$project_root\chef-powershell\bin\ruby_bin_folder\$arch")

if (Test-Path -PathType Container $x64_bin_path) {
Write-Output "My 64-bit path WAS found here : $x64_bin_path"
Expand Down
3 changes: 2 additions & 1 deletion .expeditor/manual_gem_release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ if (-not $?) { throw "unable to install this build" }
Write-Output "`r"

Write-Output "--- :cleanup, cleanup, everybody, everywhere: Deleting existing DLL's in the chef-powershell Directory and copying the newly compiled ones down"
$x64_bin_path = $("$project_root/chef-powershell/bin/ruby_bin_folder/AMD64")
$arch = if ($env:PROCESSOR_ARCHITECTURE) { $env:PROCESSOR_ARCHITECTURE } else { "AMD64" }
$x64_bin_path = $("$project_root/chef-powershell/bin/ruby_bin_folder/$arch")

if (Test-Path -PathType Container $x64_bin_path) {
Get-ChildItem -Path $x64_bin_path -Recurse | Foreach-object { Remove-item -Recurse -path $_.FullName -Force }
Expand Down
30 changes: 23 additions & 7 deletions .expeditor/update_version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,29 @@

$ErrorActionPreference = "Stop"

# get the contents of the gem version file
# Get the project root directory using git
$project_root = git rev-parse --show-toplevel
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to determine git repository root. Are you in a git repository?"
exit 1
}

# Convert Unix-style path to Windows path if necessary
$project_root = $project_root -replace '/', '\'

# Get the contents of the gem version file
$version_file = Join-Path $project_root "chef-powershell\lib\chef-powershell\version.rb"
if (-not (Test-Path $version_file)) {
Write-Error "Version file not found at: $version_file"
exit 1
}

try {
$project_root = Get-ChildItem -Path C:\ -Recurse | Where-Object { $_.PSIsContainer -eq $True -and $_.Name -like "*chef-powershell-shim*" } | % { $_.fullname } | select-object -First 1
$file = (Get-Content $("$project_root\chef-powershell\lib\chef-powershell\version.rb"))
$file = Get-Content $version_file
}
catch {
Write-Error "Failed to Get the Version from version.rb"
Write-Error "Failed to read the Version from version.rb: $_"
exit 1
}

# Use RegEx to get the Version Number and set it as a version datatype
Expand Down Expand Up @@ -48,10 +64,10 @@ else {

# Replace Old Version Number with New Version number in the file
try {
(Get-Content .\chef-powershell\lib\chef-powershell\version.rb) -replace $version, $NewVersion | Out-File .\chef-powershell\lib\chef-powershell\version.rb
(Get-Content $version_file) -replace $version, $NewVersion | Set-Content $version_file -Encoding UTF8
Write-Output "Updated Module Version from $Version to $NewVersion"
}
catch {
$_
Write-Error "failed to set file"
Write-Error "Failed to update version file: $_"
exit 1
}
Loading