From 14c08f8b6c51b1ad58323f080f756a6e22fcc34e Mon Sep 17 00:00:00 2001 From: Adrien Abraham Date: Wed, 7 Sep 2022 12:19:27 +0200 Subject: [PATCH] install: add fancy install script --- install.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..894cf4b --- /dev/null +++ b/install.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +ensure_has() { + if ! command -v "$1" > /dev/null; then + echo "Can't find $1." + exit 1 + fi +} + +ensure_has fdfind +ensure_has fzf +ensure_has install-script + +fdfind -t x \ + | fzf -m --layout=reverse \ + | while read -r script; do install-script "$script"; done