Skip to content

Commit

Permalink
✨ better install
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaillon committed Jul 8, 2024
1 parent 43a7d14 commit 37145a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/content/docs/002.installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests.d/1106-self-update/01.self-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion tests.d/1106-self-update/results.approved.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions valet.d/commands.d/self-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion valet.d/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20.0
0.20.3

0 comments on commit 37145a4

Please sign in to comment.