Skip to content

Commit

Permalink
Merge pull request #11 from nodenv/lint
Browse files Browse the repository at this point in the history
Lint fixes

(rebased from commit eb3c5f4)
  • Loading branch information
jasonkarns committed Feb 27, 2023
1 parent 60d4e10 commit bafd754
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
17 changes: 4 additions & 13 deletions bin/nodenv-doctor
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Usage: nodenv doctor
# Summary: Detects common problems in nodenv installation

set -e
[ -n "$NODENV_DEBUG" ] && set -x
[ -n "$NODENV_DEBUG" ] && { export PS4='+ [${BASH_SOURCE##*/}:${LINENO}] '; set -x; }

count-lines() {
printf "%d" "$(wc -l)"
Expand Down Expand Up @@ -49,6 +49,7 @@ else
color_yellow=""
# shellcheck disable=SC2034
color_bright=""
# shellcheck disable=SC2034
color_reset=""
fi

Expand Down Expand Up @@ -176,19 +177,9 @@ echo -n "Auditing installed plugins: "
hooks_list="$(nodenv hooks exec || true)"
IFS=$'\n' read -r -d '' -a hooks <<<"$hooks_list" || true
plugin_broken=0
for hook in "${hooks[@]}"; do
while IFS='' read -r hook; do
plugin_name=
message=
case "$hook" in
*/"~gem-rehash.bash" )
plugin_name=nodenv-gem-rehash
message="functionality is now included in nodenv core. Please remove the plugin."
;;
*/"bundler.bash" )
plugin_name=nodenv-bundler
message="is considered harmful. Please remove the plugin and \`rm -rf \$(nodenv root)/shims && nodenv rehash'."
;;
esac

if [ -n "$plugin_name" ]; then
if [ "$((plugin_broken++))" -eq 0 ]; then
Expand Down
4 changes: 3 additions & 1 deletion bin/nodenv-installer
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash

set -e
[ -n "$NODENV_DEBUG" ] && { export PS4='+ [${BASH_SOURCE##*/}:${LINENO}] '; set -x; }

homebrew=
type -p brew >/dev/null && homebrew=1
Expand Down

0 comments on commit bafd754

Please sign in to comment.