scoop package support for [SessionData]
was supposed to be added with [SessionData] commit
This commit is contained in:
parent
6fb86bf855
commit
649b01ce1c
|
@ -1,17 +1,19 @@
|
||||||
param([switch]$Force)
|
param([switch]$Force)
|
||||||
|
|
||||||
if( -not $global:ThisSeszion -or $Force ) {
|
if( -not (Test-Path variable:global:ScoopRefreshed) ) {
|
||||||
$global:MyModulesWarning = @()
|
scoop autocomplete-on
|
||||||
}
|
}
|
||||||
|
$global:ScoopRefreshed = [SessionData]::Get("ScoopRefreshed",$false)
|
||||||
|
|
||||||
|
if( -not $ScoopRefreshed ) {
|
||||||
scoop autocomplete-on
|
if( Test-Path (Join-Path $env:SCOOP last-scoop-refresh.clixml) ) {
|
||||||
|
|
||||||
if( Test-Path (Join-Path $env:SCOOP last-scoop-refresh.clixml) ) {
|
|
||||||
if($Host.Name -ne 'Visual Studio Code Host' ) {
|
if($Host.Name -ne 'Visual Studio Code Host' ) {
|
||||||
scoop refresh
|
scoop refresh
|
||||||
|
[SessionData]::Set("ScoopRefreshed",$true)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Write-Warning ("No recorded time for last 'scoop refresh', to remedy, run 'scoop refresh' at least once manually." +
|
Write-Warning ("No recorded time for last 'scoop refresh', to remedy, run 'scoop refresh' at least once manually." +
|
||||||
"`nIf the issue still persists, please run 'scoop alias-update' to update to latest refresh code, and try again.")
|
"`nIf the issue still persists, please run 'scoop alias-update' to update to latest refresh code, and try again.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue