27 lines
736 B
PowerShell
27 lines
736 B
PowerShell
#Function to check if modification exists in 'mods' directory
|
|
|
|
function Test-Mods ($app) {
|
|
|
|
#Takes care of a null situation
|
|
$ModsPreInstall = $null
|
|
$ModsInstall = $null
|
|
$ModsUpgrade = $null
|
|
|
|
$Mods = "$WorkingDir\mods"
|
|
if (Test-Path "$Mods\$app-*") {
|
|
if (Test-Path "$Mods\$app-preinstall.ps1") {
|
|
$ModsPreInstall = "$Mods\$app-preinstall.ps1"
|
|
}
|
|
if (Test-Path "$Mods\$app-install.ps1") {
|
|
$ModsInstall = "$Mods\$app-install.ps1"
|
|
$ModsUpgrade = "$Mods\$app-install.ps1"
|
|
}
|
|
if (Test-Path "$Mods\$app-upgrade.ps1") {
|
|
$ModsUpgrade = "$Mods\$app-upgrade.ps1"
|
|
}
|
|
}
|
|
|
|
return $ModsPreInstall, $ModsInstall, $ModsUpgrade
|
|
|
|
}
|