mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
chore: format & endline white spaces
This commit is contained in:
parent
b463071088
commit
df221299d9
1 changed files with 34 additions and 34 deletions
66
src/shell.rs
66
src/shell.rs
|
|
@ -208,25 +208,25 @@ def --env {} [] {{
|
|||
),
|
||||
"pwsh" | "powershell" => format!(
|
||||
r#"& {{
|
||||
try {{
|
||||
# fetch command and error from session history only when not in cnf mode
|
||||
if ($env:_PR_MODE -ne 'cnf') {{
|
||||
$env:_PR_LAST_COMMAND = ({});
|
||||
$err = Get-Error;
|
||||
if ($env:_PR_LAST_COMMAND -eq $err.InvocationInfo.Line) {{
|
||||
$env:_PR_ERROR_MSG = $err.Exception.Message
|
||||
}}
|
||||
}}
|
||||
$env:_PR_SHELL = '{}';
|
||||
&'{}';
|
||||
}}
|
||||
finally {{
|
||||
# restore mode from cnf
|
||||
if ($env:_PR_MODE -eq 'cnf') {{
|
||||
$env:_PR_MODE = $env:_PR_PWSH_ORIGIN_MODE;
|
||||
$env:_PR_PWSH_ORIGIN_MODE = $null;
|
||||
}}
|
||||
}}
|
||||
try {{
|
||||
# fetch command and error from session history only when not in cnf mode
|
||||
if ($env:_PR_MODE -ne 'cnf') {{
|
||||
$env:_PR_LAST_COMMAND = ({});
|
||||
$err = Get-Error;
|
||||
if ($env:_PR_LAST_COMMAND -eq $err.InvocationInfo.Line) {{
|
||||
$env:_PR_ERROR_MSG = $err.Exception.Message
|
||||
}}
|
||||
}}
|
||||
$env:_PR_SHELL = '{}';
|
||||
&'{}';
|
||||
}}
|
||||
finally {{
|
||||
# restore mode from cnf
|
||||
if ($env:_PR_MODE -eq 'cnf') {{
|
||||
$env:_PR_MODE = $env:_PR_PWSH_ORIGIN_MODE;
|
||||
$env:_PR_PWSH_ORIGIN_MODE = $null;
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
"#,
|
||||
last_command, shell, binary_path
|
||||
|
|
@ -311,20 +311,20 @@ end
|
|||
r#"{}
|
||||
$ExecutionContext.InvokeCommand.CommandNotFoundAction =
|
||||
{{
|
||||
param(
|
||||
[string]
|
||||
$commandName,
|
||||
[System.Management.Automation.CommandLookupEventArgs]
|
||||
$eventArgs
|
||||
)
|
||||
# powershell does not support run command with specific environment variables
|
||||
# but you must set global variables. so we are memorizing the current mode and the alias function will reset it later.
|
||||
$env:_PR_PWSH_ORIGIN_MODE=$env:_PR_MODE;
|
||||
$env:_PR_MODE='cnf';
|
||||
# powershell may search command with prefix 'get-' or '.\' first when this hook is hit, strip them
|
||||
$env:_PR_LAST_COMMAND=$commandName -replace '^get-|\.\\','';
|
||||
$eventArgs.Command = (Get-Command {});
|
||||
$eventArgs.StopSearch = $True;
|
||||
param(
|
||||
[string]
|
||||
$commandName,
|
||||
[System.Management.Automation.CommandLookupEventArgs]
|
||||
$eventArgs
|
||||
)
|
||||
# powershell does not support run command with specific environment variables
|
||||
# but you must set global variables. so we are memorizing the current mode and the alias function will reset it later.
|
||||
$env:_PR_PWSH_ORIGIN_MODE=$env:_PR_MODE;
|
||||
$env:_PR_MODE='cnf';
|
||||
# powershell may search command with prefix 'get-' or '.\' first when this hook is hit, strip them
|
||||
$env:_PR_LAST_COMMAND=$commandName -replace '^get-|\.\\','';
|
||||
$eventArgs.Command = (Get-Command {});
|
||||
$eventArgs.StopSearch = $True;
|
||||
}}
|
||||
"#,
|
||||
init, auto_alias
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue