fix: remove unnecessary cd commands (#257)

This commit is contained in:
Travis Lyons
2025-11-08 03:10:43 -05:00
committed by GitHub
parent f72a1d826d
commit d8c04260b6

View File

@@ -121,7 +121,6 @@ install_from_release() {
# Extract archive # Extract archive
log_info "Extracting archive..." log_info "Extracting archive..."
cd - > /dev/null || cd "$HOME"
if ! tar -xzf "$archive_name"; then if ! tar -xzf "$archive_name"; then
log_error "Failed to extract archive" log_error "Failed to extract archive"
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
@@ -154,10 +153,9 @@ install_from_release() {
echo "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):" echo "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo " export PATH=\"\$PATH:$install_dir\"" echo " export PATH=\"\$PATH:$install_dir\""
echo "" echo ""
cd - > /dev/null || cd "$HOME"
fi fi
cd - > /dev/null cd - > /dev/null || cd "$HOME"
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
return 0 return 0
} }
@@ -265,12 +263,10 @@ build_from_source() {
echo "" echo ""
echo "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):" echo "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo " export PATH=\"\$PATH:$install_dir\"" echo " export PATH=\"\$PATH:$install_dir\""
cd - > /dev/null || cd "$HOME"
echo "" echo ""
fi fi
cd - > /dev/null cd - > /dev/null || cd "$HOME"
cd - > /dev/null || cd "$HOME"
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
return 0 return 0
else else
@@ -442,3 +438,4 @@ main() {
} }
main "$@" main "$@"