Skip to content

Commit

Permalink
Redo snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Nov 15, 2024
1 parent d4d4dcd commit f06319a
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion crates/shell/src/shells/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ mod tests {
fn formats_cd_hook() {
let hook = Hook::OnChangeDir {
command: "starbase hook bash".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Bash.format_hook(hook).unwrap());
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/shells/elvish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ mod tests {
fn formats_cd_hook() {
let hook = Hook::OnChangeDir {
command: "starbase hook elvish".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Elvish.format_hook(hook).unwrap());
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/shells/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod tests {
fn formats_cd_hook() {
let hook = Hook::OnChangeDir {
command: "starbase hook fish".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Fish.format_hook(hook).unwrap());
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/shells/murex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ mod tests {
fn formats_cd_hook() {
let hook = Hook::OnChangeDir {
command: "starbase hook murex".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Murex.format_hook(hook).unwrap());
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/shells/nu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ mod tests {

let hook = Hook::OnChangeDir {
command: "starbase hook nu".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Nu.format_hook(hook).unwrap());
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/shells/pwsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ mod tests {
fn formats_cd_hook() {
let hook = Hook::OnChangeDir {
command: "starbase hook pwsh".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Pwsh.format_hook(hook).unwrap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: Bash.format_hook(hook).unwrap()
---
export __ORIG_PATH="$PATH"

starbase() {
_starbase_hook() {
local previous_exit_status=$?;
trap '' SIGINT;
output=$(starbase hook bash)
Expand All @@ -15,10 +15,10 @@ starbase() {
return $previous_exit_status;
};

if [[ ";${PROMPT_COMMAND[*]:-};" != *";starbase;"* ]]; then
if [[ ";${PROMPT_COMMAND[*]:-};" != *";_starbase_hook;"* ]]; then
if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then
PROMPT_COMMAND=(starbase "${PROMPT_COMMAND[@]}")
PROMPT_COMMAND=(_starbase_hook "${PROMPT_COMMAND[@]}")
else
PROMPT_COMMAND="starbase${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
PROMPT_COMMAND="_starbase_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ expression: Elvish.format_hook(hook).unwrap()
---
set-env __ORIG_PATH $E:PATH

fn starbase {
fn _starbase_hook {
eval (starbase hook elvish);
}

set @edit:before-readline = $@edit:before-readline {
starbase
_starbase_hook
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ expression: Fish.format_hook(hook).unwrap()
---
set -gx __ORIG_PATH $PATH

function starbase --on-variable PWD;
function _starbase_hook --on-variable PWD;
starbase hook fish | source
end;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ expression: Murex.format_hook(hook).unwrap()
---
$ENV.__ORIG_PATH="$ENV.PATH"

function starbase {
function _starbase_hook {
starbase hook murex -> source
}

event onPrompt starbase_hook=before {
starbase
event onPrompt _starbase_hook_hook=before {
_starbase_hook
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: Pwsh.format_hook(hook).unwrap()
---
$env.__ORIG_PATH = "$env.PATH"

function starbase {
function _starbase_hook {
$exports = starbase hook pwsh;
if ($exports) {
Invoke-Expression -Command $exports;
Expand All @@ -17,7 +17,7 @@ using namespace System.Management.Automation;
$hook = [EventHandler[LocationChangedEventArgs]] {
param([object] $source, [LocationChangedEventArgs] $eventArgs)
end {
starbase
_starbase_hook
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: "Zsh::default().format_hook(hook).unwrap()"
---
export __ORIG_PATH="$PATH"

starbase() {
_starbase_hook() {
trap '' SIGINT
output=$(starbase hook zsh)
if [ -n "$output" ]; then
Expand All @@ -14,6 +14,6 @@ starbase() {
}

typeset -ag chpwd_functions
if (( ! ${chpwd_functions[(I)starbase]} )); then
chpwd_functions=(starbase $chpwd_functions)
if (( ! ${chpwd_functions[(I)_starbase_hook]} )); then
chpwd_functions=(_starbase_hook $chpwd_functions)
fi
2 changes: 1 addition & 1 deletion crates/shell/src/shells/zsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod tests {
fn formats_cd_hook() {
let hook = Hook::OnChangeDir {
command: "starbase hook zsh".into(),
function: "starbase".into(),
function: "_starbase_hook".into(),
};

assert_snapshot!(Zsh::default().format_hook(hook).unwrap());
Expand Down

0 comments on commit f06319a

Please sign in to comment.