fix path and IO redirection
This commit is contained in:
parent
3614accd76
commit
73ffdfd63a
2 changed files with 5 additions and 5 deletions
|
@ -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
8
update
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue