feat(installer-pwsh): extract profile paths from profiles.ini files

This commit is contained in:
James Upjohn 2021-07-15 21:47:37 +12:00
parent 34601bd7eb
commit 6cddce4dcf
No known key found for this signature in database
GPG key ID: D27176569247601C

View file

@ -211,13 +211,23 @@ function Check-FirefoxProfileConfigurations {
Write-Host "[found]"
}
function Check-FirefoxProfileConfigurations {
param ([string[]]$InstallDirectories)
# TODO: stub
}
function Get-FirefoxProfilePaths {
# TODO: stub
param ([string[]]$InstallDirectories)
Write-Host -Nonewline "Checking path information for profiles... "
$AbsoluteProfiles = @()
foreach ($Directory in $InstallDirectories) {
$InfoFileContents = (Get-Content -Path (-Join $Directory, "\", $ProfileInfoFile)) -Split "\n"
$PathNames = $InfoFileContents
.Where({$_ -Match "Path=.+"})
.ForEach({$_ -Replace "Path=",""})
.ForEach({$AbsoluteProfiles += (-Join $Directory, "\", $_)})
}
# TODO: error handling
return $AbsoluteProfiles
}
function Install-LeptonToProfiles {
@ -239,7 +249,7 @@ function Install-Lepton {
Check-FirefoxProfileConfigurations $InstallationDirectories
# TODO: read profile paths in from profiles.ini files
#$AsboluteProfilePaths = Get-FirefoxProfilePaths
$AsboluteProfilePaths = Get-FirefoxProfilePaths
# TODO: install if in install mode
#Install-LeptonToProfiles $AbsoluteProfilePaths