Skip to content

Commit

Permalink
Use mise instead of asdf if present
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Dec 24, 2024
1 parent 5ca4a7c commit c8bb751
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
4 changes: 1 addition & 3 deletions packages/ansible-language-server/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ tasks:
dir: "{{ .TASKFILE_DIR }}"
desc: Update dependencies
cmds:
- npm install -g npm@latest
# - installs tools from .tool-versions
- asdf install
- task: shared:setup
- "{{.VIRTUAL_ENV}}/bin/python3 -m pre_commit autoupdate"
- npm outdated
# bumps some developments dependencies
Expand Down
39 changes: 24 additions & 15 deletions tools/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,30 @@ if [[ -z "${HOSTNAME:-}" ]]; then
exit 2
fi

log notice "Install required build tools"
for PLUGIN in yarn nodejs task python direnv; do
if ! asdf plugin-list | grep -q $PLUGIN; then
asdf plugin add $PLUGIN
fi
done
asdf install
log notice "Install required build tools (mise/asdf)..."

if type mise >/dev/null; then
VERSION_MANAGER=mise
mise install
else
VERSION_MANAGER=asdf
echo "mise not found, trying to use asdf"

for PLUGIN in yarn nodejs task python direnv; do
if ! asdf plugin-list | grep -q $PLUGIN; then
asdf plugin add $PLUGIN
fi
done
asdf install

log notice "Report current build tool versions..."
asdf current
log notice "Report current build tool versions..."
asdf current
fi

command -v npm >/dev/null 2>&1 || {
log error "Failed to find npm."
exit 56
}

if [[ "${OSTYPE:-}" != darwin* ]]; then
pgrep "dbus-(daemon|broker)" >/dev/null || {
Expand Down Expand Up @@ -333,11 +347,6 @@ for CMD in ansible ansible-lint; do
done
unset CMD

command -v npm >/dev/null 2>&1 || {
log notice "Installing nodejs stable."
asdf install
}

if [[ -f yarn.lock ]]; then
command -v yarn >/dev/null 2>&1 || {
# Check if npm has permissions to install packages (system installed does not)
Expand Down Expand Up @@ -479,7 +488,7 @@ env:
tools:
ansible-lint: $(get_version ansible-lint)
ansible: $(get_version ansible)
asdf: $(get_version asdf)
$VERSION_MANAGER: $(get_version $VERSION_MANAGER)
bash: $(get_version bash)
gh: $(get_version gh || echo null)
git: $(get_version git)
Expand Down

0 comments on commit c8bb751

Please sign in to comment.