fix path and IO redirection

This commit is contained in:
Tim Schubert 2022-05-21 15:07:34 +02:00
parent 3614accd76
commit 73ffdfd63a
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
2 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ FROM alpine/git
RUN apk add --no-cache curl
ADD update /bin/update
ADD ./update /usr/bin/update
# Override ENTRYPOINT of alpine/git
ENTRYPOINT /bin/sh

8
update
View file

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/sh
update() {
url="$1"
@ -30,13 +30,13 @@ update() {
echo "\e[1;32mUpdated ${dst} from ${url}\e[0m"
}
if ! git rev-parse --is-inside-work-tree > /dev/null
if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1
then
echo -e "\e[1;31mNot a working directory\e[0m"
echo -e "\e[1;31mNot a git directory\e[0m"
exit 1
fi
gitdir="$(realpath ${1:-$PWD})"
gitdir="$(realpath "${1:-$PWD}")"
while read -r pad
do
update "$pad"