Check nak installation

Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
dzdidi
2024-01-18 21:03:09 +00:00
parent 16d341f3a2
commit 2fb1883c39
2 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
# Client # Client
Requires [nak](https://github.com/fiatjaf/nak/tree/master)
1. add `./nga` to you `$PATH` 1. add `./nga` to you `$PATH`
2. run `nga` and follow instructions 2. run `nga` and follow instructions

10
nga.sh
View File

@@ -1,6 +1,11 @@
#!/bin/bash #!/bin/bash
set -e set -e
if ! [ -x "$(command -v nak)" ]; then
echo 'Error: nak is not installed.' >&2
echo 'Please install nak from https://github.com/fiatjaf/nak/tree/master'
fi
HOOK=`cat <<'EOF' HOOK=`cat <<'EOF'
#!/bin/sh\n #!/bin/sh\n
\n \n
@@ -37,11 +42,6 @@ fi
read -p "Provide path to git repository or press \"Enter\" to use curent directory:" GIT_REPO read -p "Provide path to git repository or press \"Enter\" to use curent directory:" GIT_REPO
GIT_REPO=${GIT_REPO:-.} GIT_REPO=${GIT_REPO:-.}
if [ ! -d $GIT_REPO ]; then
echo "$GIT_REPO is not a directory. Exiting..."
exit 1
fi
if [ ! -d "$GIT_REPO/.git" ]; then if [ ! -d "$GIT_REPO/.git" ]; then
echo "$GIT_REPO is not a directory. Exiting..." echo "$GIT_REPO is not a directory. Exiting..."
exit 1 exit 1