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
68
src/shell.rs
68
src/shell.rs
|
|
@ -208,25 +208,25 @@ def --env {} [] {{
|
||||||
),
|
),
|
||||||
"pwsh" | "powershell" => format!(
|
"pwsh" | "powershell" => format!(
|
||||||
r#"& {{
|
r#"& {{
|
||||||
try {{
|
try {{
|
||||||
# fetch command and error from session history only when not in cnf mode
|
# fetch command and error from session history only when not in cnf mode
|
||||||
if ($env:_PR_MODE -ne 'cnf') {{
|
if ($env:_PR_MODE -ne 'cnf') {{
|
||||||
$env:_PR_LAST_COMMAND = ({});
|
$env:_PR_LAST_COMMAND = ({});
|
||||||
$err = Get-Error;
|
$err = Get-Error;
|
||||||
if ($env:_PR_LAST_COMMAND -eq $err.InvocationInfo.Line) {{
|
if ($env:_PR_LAST_COMMAND -eq $err.InvocationInfo.Line) {{
|
||||||
$env:_PR_ERROR_MSG = $err.Exception.Message
|
$env:_PR_ERROR_MSG = $err.Exception.Message
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
$env:_PR_SHELL = '{}';
|
$env:_PR_SHELL = '{}';
|
||||||
&'{}';
|
&'{}';
|
||||||
}}
|
}}
|
||||||
finally {{
|
finally {{
|
||||||
# restore mode from cnf
|
# restore mode from cnf
|
||||||
if ($env:_PR_MODE -eq 'cnf') {{
|
if ($env:_PR_MODE -eq 'cnf') {{
|
||||||
$env:_PR_MODE = $env:_PR_PWSH_ORIGIN_MODE;
|
$env:_PR_MODE = $env:_PR_PWSH_ORIGIN_MODE;
|
||||||
$env:_PR_PWSH_ORIGIN_MODE = $null;
|
$env:_PR_PWSH_ORIGIN_MODE = $null;
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
"#,
|
"#,
|
||||||
last_command, shell, binary_path
|
last_command, shell, binary_path
|
||||||
|
|
@ -309,22 +309,22 @@ end
|
||||||
"pwsh" | "powershell" => {
|
"pwsh" | "powershell" => {
|
||||||
init = format!(
|
init = format!(
|
||||||
r#"{}
|
r#"{}
|
||||||
$ExecutionContext.InvokeCommand.CommandNotFoundAction =
|
$ExecutionContext.InvokeCommand.CommandNotFoundAction =
|
||||||
{{
|
{{
|
||||||
param(
|
param(
|
||||||
[string]
|
[string]
|
||||||
$commandName,
|
$commandName,
|
||||||
[System.Management.Automation.CommandLookupEventArgs]
|
[System.Management.Automation.CommandLookupEventArgs]
|
||||||
$eventArgs
|
$eventArgs
|
||||||
)
|
)
|
||||||
# powershell does not support run command with specific environment variables
|
# 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.
|
# 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_PWSH_ORIGIN_MODE=$env:_PR_MODE;
|
||||||
$env:_PR_MODE='cnf';
|
$env:_PR_MODE='cnf';
|
||||||
# powershell may search command with prefix 'get-' or '.\' first when this hook is hit, strip them
|
# powershell may search command with prefix 'get-' or '.\' first when this hook is hit, strip them
|
||||||
$env:_PR_LAST_COMMAND=$commandName -replace '^get-|\.\\','';
|
$env:_PR_LAST_COMMAND=$commandName -replace '^get-|\.\\','';
|
||||||
$eventArgs.Command = (Get-Command {});
|
$eventArgs.Command = (Get-Command {});
|
||||||
$eventArgs.StopSearch = $True;
|
$eventArgs.StopSearch = $True;
|
||||||
}}
|
}}
|
||||||
"#,
|
"#,
|
||||||
init, auto_alias
|
init, auto_alias
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue