Skip to content

Commit

Permalink
Updated build script
Browse files Browse the repository at this point in the history
  • Loading branch information
ygoe committed Dec 4, 2015
1 parent e32bbb8 commit bbc2f2a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 14 deletions.
26 changes: 26 additions & 0 deletions _scripts/buildscript/modules/file.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ function Copy-File($src, $dest, $time = 0)
$global:actions += @{ action = "Do-Copy-File"; src = $src; dest = $dest; time = $time }
}

# Moves a file.
#
# $src = The name of the source file.
# $dest = The name of the destination file. Can be a directory.
#
function Move-File($src, $dest, $time = 0)
{
$global:actions += @{ action = "Do-Move-File"; src = $src; dest = $dest; time = $time }
}

# Deletes a file.
#
# $file = The name of the file to delete.
Expand Down Expand Up @@ -180,6 +190,22 @@ function Do-Copy-File($action)
}
}

function Do-Move-File($action)
{
$src = $action.src
$dest = $action.dest

Write-Host ""
Write-Host -ForegroundColor DarkCyan "Moving $src to $dest..."

Move-Item (MakeRootedPath $src) (MakeRootedPath $dest)
if (-not $?)
{
WaitError "Move failed"
exit 1
}
}

function Do-Delete-File($action)
{
$file = $action.file
Expand Down
38 changes: 24 additions & 14 deletions _scripts/buildscript/modules/git.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,22 @@ function Do-Git-Export($action)
[System.Console]::OutputEncoding = $consoleEncoding

# Find the Git binary
$gitBin = Check-RegFilename "hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-RegFilename "hklm:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-Filename "$gitBin\bin\git.exe"
if ($gitBin -eq $null)
{
$gitBin = Check-RegFilename "hklm:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-RegFilename "hklm:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-Filename "$gitBin\bin\git.exe"
if ($gitBin -eq $null)
{
WaitError "Git binary not found"
exit 1
}
}
if ($gitBin -eq $null)
{
$gitBin = Check-RegFilename "hkcu:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-Filename "$gitBin\bin\git.exe"
}
if ($gitBin -eq $null)
{
WaitError "Git binary not found"
exit 1
}

# Find the 7-Zip binary
Expand Down Expand Up @@ -173,17 +178,22 @@ function Do-Git-Log($action)
[System.Console]::OutputEncoding = $consoleEncoding

# Find the Git binary
$gitBin = Check-RegFilename "hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-RegFilename "hklm:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-Filename "$gitBin\bin\git.exe"
if ($gitBin -eq $null)
{
$gitBin = Check-RegFilename "hklm:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-RegFilename "hklm:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-Filename "$gitBin\bin\git.exe"
if ($gitBin -eq $null)
{
WaitError "Git binary not found"
exit 1
}
}
if ($gitBin -eq $null)
{
$gitBin = Check-RegFilename "hkcu:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" "InstallLocation"
$gitBin = Check-Filename "$gitBin\bin\git.exe"
}
if ($gitBin -eq $null)
{
WaitError "Git binary not found"
exit 1
}

# Read the output log file and determine the last added revision
Expand Down

0 comments on commit bbc2f2a

Please sign in to comment.