Fixed startup issues
Fixed Package condition testing which would fail, but also made it more verbose. Fixed shell-loading-snippets because of the rename to Setup-ScriptEnv.
This commit is contained in:
parent
5b8f0ca309
commit
35fe3a156f
|
@ -20,6 +20,10 @@ class Packagesz { #: System.Management.Automation.IValidateSetValuesGenerator {
|
|||
}
|
||||
static [bool] ValidatePackageConditions($Package) {
|
||||
if( -not $Package.Condition ) { return $true }
|
||||
$local:badCnd = $Package.Condition |
|
||||
Get-Member -MemberType NoteProperty |
|
||||
Where-Object Name -notin ('Logic', 'custom', 'System','Hostname','Username','CmdletExists','AppExeExists')
|
||||
if( $badCnd ) { Write-Warning "Bad conditions for Package $($Package.name): $($badCnd.Name -join ', ')"; return $false }
|
||||
$local:valid = $Package.Condition[0].Logic -notin ([szLogic]::or, [szLogic]::ornot)
|
||||
$local:currentSys = [SystemName]::_GetValidValues('',$true,$true);
|
||||
$local:hostname = $(hostname)
|
||||
|
|
|
@ -8,10 +8,10 @@ if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]
|
|||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
fi
|
||||
|
||||
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-Profile: $(ls ~/.local/share/powershell/Scripts/Setup-Profile.ps1) " >> /tmp/default_shell
|
||||
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell
|
||||
if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
|
||||
export SZ_SKIP_DEFAULT_SHELL=1
|
||||
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-Profile.ps1 ]]; then
|
||||
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then
|
||||
echo 'Starting PowerShell SZcripts...'
|
||||
echo "pwsh" >> /tmp/default_shell
|
||||
pwsh
|
||||
|
|
|
@ -8,10 +8,10 @@ if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]
|
|||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
fi
|
||||
|
||||
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-Profile: $(ls ~/.local/share/powershell/Scripts/Setup-Profile.ps1) " >> /tmp/default_shell
|
||||
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell
|
||||
if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
|
||||
export SZ_SKIP_DEFAULT_SHELL=1
|
||||
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-Profile.ps1 ]]; then
|
||||
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then
|
||||
echo 'Starting PowerShell SZcripts...'
|
||||
echo "pwsh" >> /tmp/default_shell
|
||||
pwsh
|
||||
|
|
|
@ -8,10 +8,10 @@ if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]
|
|||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
fi
|
||||
|
||||
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-Profile: $(ls ~/.local/share/powershell/Scripts/Setup-Profile.ps1) " >> /tmp/default_shell
|
||||
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell
|
||||
if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
|
||||
export SZ_SKIP_DEFAULT_SHELL=1
|
||||
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-Profile.ps1 ]]; then
|
||||
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then
|
||||
echo 'Starting PowerShell SZcripts...'
|
||||
echo "pwsh" >> /tmp/default_shell
|
||||
pwsh
|
||||
|
|
Loading…
Reference in New Issue