From 37145a4934d7f3fc7dded74924d29959c8c1a316 Mon Sep 17 00:00:00 2001 From: Julien Caillon Date: Mon, 8 Jul 2024 19:18:53 +0200 Subject: [PATCH] :sparkles: better install --- docs/content/docs/002.installation/_index.md | 2 +- tests.d/1106-self-update/01.self-update.sh | 2 +- tests.d/1106-self-update/results.approved.md | 2 +- valet.d/commands.d/self-install.sh | 9 +++++++++ valet.d/version | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/content/docs/002.installation/_index.md b/docs/content/docs/002.installation/_index.md index a9e4641..41f0bdc 100644 --- a/docs/content/docs/002.installation/_index.md +++ b/docs/content/docs/002.installation/_index.md @@ -9,7 +9,7 @@ url: /docs/installation ## πŸ“¦ Dependencies - Bash version 5 or superior is required (might work with older versions but it is not guaranteed). -- From [GNU coreutils][gnu-core-utils]: it uses `rm`, `mv`, `mkdir` for all commands. It uses `chmod`, `ln` for the installation/updates. *You most likely already have all of these!* +- From [GNU coreutils][gnu-core-utils]: it uses `rm`, `mv`, `mkdir` for all commands. It uses `cp`, `chmod`, `touch` for the installation/updates. *You most likely already have all of these!* - [curl][curl] and [tar][tar] are needed only if you want to use the self-update command. ## 🚚 Automated installation diff --git a/tests.d/1106-self-update/01.self-update.sh b/tests.d/1106-self-update/01.self-update.sh index 86adaea..7b58bfe 100644 --- a/tests.d/1106-self-update/01.self-update.sh +++ b/tests.d/1106-self-update/01.self-update.sh @@ -3,7 +3,7 @@ core::sourceFunction "selfUpdate" function testSelfUpdateDocumentation() { - echo "β†’ ./self-update.sh --help" + echo "β†’ valet self update --help" (selfUpdate --help) test::endTest "Install script usage" 0 } diff --git a/tests.d/1106-self-update/results.approved.md b/tests.d/1106-self-update/results.approved.md index 7a530ad..d1dd4ee 100644 --- a/tests.d/1106-self-update/results.approved.md +++ b/tests.d/1106-self-update/results.approved.md @@ -9,7 +9,7 @@ Exit code: `0` **Standard** output: ```plaintext -β†’ ./self-update.sh --help +β†’ valet self update --help ABOUT Update valet using the latest release on GitHub. diff --git a/valet.d/commands.d/self-install.sh b/valet.d/commands.d/self-install.sh index 1d96953..12b42b0 100644 --- a/valet.d/commands.d/self-install.sh +++ b/valet.d/commands.d/self-install.sh @@ -410,6 +410,10 @@ function selfUpdate::updateGitRepository() { core::fail "The directory ⌜${1}⌝ is not a git repository." fi + if ! command -v git; then + core::fail "The command ⌜git⌝ is not installed or not found in your PATH." + fi + log::debug "Updating the git repository ⌜${1}⌝." io::readFile "${1}/.git/HEAD" @@ -595,6 +599,11 @@ function selfUpdate::updateUserRepositories() { log::info "Attempting to update the git repositories in ⌜${userDirectory}⌝." + if ! command -v git; then + log::warning "The command ⌜git⌝ is not installed or not found in your PATH, skipping git update." + return 0 + fi + function filterGitRepositories() { if [[ -d "${1}/.git" ]]; then return 1 diff --git a/valet.d/version b/valet.d/version index a881cf7..3428dd4 100644 --- a/valet.d/version +++ b/valet.d/version @@ -1 +1 @@ -0.20.0 \ No newline at end of file +0.20.3 \ No newline at end of file