mirror of
https://github.com/denisidoro/navi
synced 2024-11-24 20:43:06 +00:00
parent
f1fee67a0f
commit
c8764ae224
6 changed files with 32 additions and 19 deletions
10
navi
10
navi
|
@ -3,14 +3,6 @@ set -euo pipefail
|
|||
|
||||
export SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
source "${SCRIPT_DIR}/src/arg.sh"
|
||||
source "${SCRIPT_DIR}/src/cheat.sh"
|
||||
source "${SCRIPT_DIR}/src/docs.sh"
|
||||
source "${SCRIPT_DIR}/src/misc.sh"
|
||||
source "${SCRIPT_DIR}/src/selection.sh"
|
||||
source "${SCRIPT_DIR}/src/str.sh"
|
||||
source "${SCRIPT_DIR}/src/ui.sh"
|
||||
|
||||
source "${SCRIPT_DIR}/src/main.sh"
|
||||
|
||||
##? Command cheatsheet tool
|
||||
|
@ -24,4 +16,6 @@ source "${SCRIPT_DIR}/src/main.sh"
|
|||
|
||||
VERSION="0.6.1"
|
||||
docs::eval "$@"
|
||||
|
||||
health::fzf
|
||||
main "$@"
|
||||
|
|
|
@ -2,15 +2,7 @@
|
|||
set -euo pipefail
|
||||
|
||||
export SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
command_exists () {
|
||||
type "$1" &> /dev/null
|
||||
}
|
||||
|
||||
echoerr() {
|
||||
echo "$@" 1>&2
|
||||
}
|
||||
source "${SCRIPT_DIR}/src/main.sh"
|
||||
|
||||
sha256() {
|
||||
if command_exists sha256sum; then
|
||||
|
@ -30,6 +22,8 @@ header() {
|
|||
echo
|
||||
}
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
header "git pull"
|
||||
git pull
|
||||
|
||||
|
|
9
src/healthcheck.sh
Normal file
9
src/healthcheck.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
health::fzf() {
|
||||
if ! command_exists fzf; then
|
||||
echoerr "You need to install fzf before using navi"
|
||||
echoerr "Please refer to https://github.com/junegunn/fzf for install instructions"
|
||||
exit 66
|
||||
fi
|
||||
}
|
|
@ -1,6 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
source "${SCRIPT_DIR}/src/arg.sh"
|
||||
source "${SCRIPT_DIR}/src/cheat.sh"
|
||||
source "${SCRIPT_DIR}/src/docs.sh"
|
||||
source "${SCRIPT_DIR}/src/healthcheck.sh"
|
||||
source "${SCRIPT_DIR}/src/misc.sh"
|
||||
source "${SCRIPT_DIR}/src/selection.sh"
|
||||
source "${SCRIPT_DIR}/src/str.sh"
|
||||
source "${SCRIPT_DIR}/src/ui.sh"
|
||||
|
||||
main() {
|
||||
local readonly cheats="$(cheat::find)"
|
||||
local readonly selection="$(ui::select "$cheats")"
|
||||
|
|
|
@ -4,3 +4,11 @@
|
|||
dep() {
|
||||
:
|
||||
}
|
||||
|
||||
command_exists () {
|
||||
type "$1" &> /dev/null
|
||||
}
|
||||
|
||||
echoerr() {
|
||||
echo "$@" 1>&2
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source <(
|
||||
grep -v 'main ' "${SCRIPT_DIR}/navi" | sed -E "s|export.*|export SCRIPT_DIR=\"${SCRIPT_DIR}\"|")
|
||||
source "${SCRIPT_DIR}/src/main.sh"
|
||||
|
||||
test::success() {
|
||||
echo "Test passed!"
|
||||
|
|
Loading…
Reference in a new issue