Skip to content

Commit

Permalink
Merge pull request #645 from axodotdev/fix_tests
Browse files Browse the repository at this point in the history
fix: tests for installer changes
  • Loading branch information
mistydemeo authored Dec 12, 2023
2 parents a5a6c5a + 0be1c28 commit 7f6a2ca
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 20 deletions.
17 changes: 12 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,18 @@ install() {

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile"
exit1=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".bash_profile .bash_login .bashrc"
exit2=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".zshrc .zshenv"
exit3=$?

if [ "${exit1:-0}" = 1 ] || [ "${exit2:-0}" = 1 ] || [ "${exit3:-0}" = 1 ]; then
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " source $_env_script_path_expr"
fi
fi
}

Expand All @@ -304,7 +314,7 @@ print_home_for_script() {
# zsh has a special ZDOTDIR directory, which if set
# should be considered instead of $HOME
.zsh*)
if [ -n "$ZDOTDIR" ]; then
if [ -n "${ZDOTDIR:-}" ]; then
_home="$ZDOTDIR"
else
_home="$HOME"
Expand Down Expand Up @@ -389,10 +399,7 @@ add_install_dir_to_path() {
if [ -f "$_env_script_path" ]; then
say_verbose "adding $_robust_line to $_target"
ensure echo "$_robust_line" >> "$_target"
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " $_pretty_line"
return 1
fi
else
say_verbose "$_install_dir already on PATH"
Expand Down
17 changes: 12 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,18 @@ install() {

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile"
exit1=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".bash_profile .bash_login .bashrc"
exit2=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".zshrc .zshenv"
exit3=$?

if [ "${exit1:-0}" = 1 ] || [ "${exit2:-0}" = 1 ] || [ "${exit3:-0}" = 1 ]; then
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " source $_env_script_path_expr"
fi
fi
}

Expand All @@ -304,7 +314,7 @@ print_home_for_script() {
# zsh has a special ZDOTDIR directory, which if set
# should be considered instead of $HOME
.zsh*)
if [ -n "$ZDOTDIR" ]; then
if [ -n "${ZDOTDIR:-}" ]; then
_home="$ZDOTDIR"
else
_home="$HOME"
Expand Down Expand Up @@ -389,10 +399,7 @@ add_install_dir_to_path() {
if [ -f "$_env_script_path" ]; then
say_verbose "adding $_robust_line to $_target"
ensure echo "$_robust_line" >> "$_target"
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " $_pretty_line"
return 1
fi
else
say_verbose "$_install_dir already on PATH"
Expand Down
17 changes: 12 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,18 @@ install() {

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile"
exit1=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".bash_profile .bash_login .bashrc"
exit2=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".zshrc .zshenv"
exit3=$?

if [ "${exit1:-0}" = 1 ] || [ "${exit2:-0}" = 1 ] || [ "${exit3:-0}" = 1 ]; then
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " source $_env_script_path_expr"
fi
fi
}

Expand All @@ -304,7 +314,7 @@ print_home_for_script() {
# zsh has a special ZDOTDIR directory, which if set
# should be considered instead of $HOME
.zsh*)
if [ -n "$ZDOTDIR" ]; then
if [ -n "${ZDOTDIR:-}" ]; then
_home="$ZDOTDIR"
else
_home="$HOME"
Expand Down Expand Up @@ -389,10 +399,7 @@ add_install_dir_to_path() {
if [ -f "$_env_script_path" ]; then
say_verbose "adding $_robust_line to $_target"
ensure echo "$_robust_line" >> "$_target"
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " $_pretty_line"
return 1
fi
else
say_verbose "$_install_dir already on PATH"
Expand Down
17 changes: 12 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,18 @@ install() {

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile"
exit1=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".bash_profile .bash_login .bashrc"
exit2=$?
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".zshrc .zshenv"
exit3=$?

if [ "${exit1:-0}" = 1 ] || [ "${exit2:-0}" = 1 ] || [ "${exit3:-0}" = 1 ]; then
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " source $_env_script_path_expr"
fi
fi
}

Expand All @@ -304,7 +314,7 @@ print_home_for_script() {
# zsh has a special ZDOTDIR directory, which if set
# should be considered instead of $HOME
.zsh*)
if [ -n "$ZDOTDIR" ]; then
if [ -n "${ZDOTDIR:-}" ]; then
_home="$ZDOTDIR"
else
_home="$HOME"
Expand Down Expand Up @@ -389,10 +399,7 @@ add_install_dir_to_path() {
if [ -f "$_env_script_path" ]; then
say_verbose "adding $_robust_line to $_target"
ensure echo "$_robust_line" >> "$_target"
say ""
say "To add $_install_dir_expr to your PATH, either restart your shell or run:"
say ""
say " $_pretty_line"
return 1
fi
else
say_verbose "$_install_dir already on PATH"
Expand Down

0 comments on commit 7f6a2ca

Please sign in to comment.