Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/checksum.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
6de66efba021ebcf462e7672577d9f6876f13db55691f04e7009ff7e78d658b8 public/sh/install_zpmod.sh
2308d14ff74b9bb5928c4d0abfb9ae0d4268cd253fb871cd3d23d4bbbede6b10 public/sh/install.sh
18f6c23188eb88242a21b6490bce922d576e571b0c5a32f1b0921a098b882273 public/sh/install.sh
08cc893ceb982fc99d17db1966c6c30790cc571e16e4f5392352d995f5252952 public/sh/sync-init.sh
c979e39748d1d86ace17a61ff2b1bf6e1224a43291c25bf7fad985d1e9e11af1 public/zsh/init.zsh
2 changes: 1 addition & 1 deletion public/sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ else
{ git clone --progress --depth=1 --branch "${BOPT}" https://github.com/z-shell/zi.git "${ZI_BIN_DIR_NAME}" \
2>&1 | { /tmp/zi/git-process-output.zsh || cat; }; } 2>/dev/null
if [ -d "${ZI_HOME}/${ZI_BIN_DIR_NAME}" ] && [ -f "${ZI_HOME}/${ZI_BIN_DIR_NAME}/zi.zsh" ]; then
printf '%s\n' "▓▒░ Successfully installed at ${ZI_HOME}/${ZI_BIN_DIR_NAME}".
printf '%s\n' "▓▒░ Successfully installed at ${ZI_HOME}/${ZI_BIN_DIR_NAME}"
else
printf '%s\n' "▓▒░ Something went wrong, couldn't install ZI at ${ZI_HOME}/${ZI_BIN_DIR_NAME}"
exit 1
Expand Down
26 changes: 26 additions & 0 deletions tests/installers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,31 @@ test_sync_init() {
pass "sync-init fixtures"
}

test_success_line_reports_exact_path() {
home="${TMP_ROOT}/success-home"
data="${TMP_ROOT}/success-data"
output="${TMP_ROOT}/success-output"
plain_output="${TMP_ROOT}/success-output-plain"
command mkdir -p "${home}"

HOME="${home}" \
ZDOTDIR="${home}" \
XDG_DATA_HOME="${data}" \
ZI_SRC_TEST_ROOT="${ROOT}" \
PATH="${FAKE_BIN}:${PATH}" \
sh "${ROOT}/public/sh/install.sh" -i skip >"${output}"

awk '{
gsub(sprintf("%c", 27) "\\[[0-9;]*m", "")
print
}' "${output}" >"${plain_output}"
success_line="$(grep 'Successfully installed at ' "${plain_output}")"
reported_path="${success_line#*Successfully installed at }"
[ "${reported_path}" = "${data}/zi/bin" ] ||
fail "success line reported ${reported_path} instead of ${data}/zi/bin"
pass "success line reports the exact installation path"
}

check_syntax
check_checksums
test_init_defaults_are_single_arguments
Expand Down Expand Up @@ -937,3 +962,4 @@ test_skip_leaves_annex_out
test_branch_option_rejects_refspec
test_zshrc_text_uses_home_variable
test_sync_init
test_success_line_reports_exact_path
Loading