From 73ffdfd63ac04f3cdb178950a1c8cc0ddd622859 Mon Sep 17 00:00:00 2001 From: dadada Date: Sat, 21 May 2022 15:07:34 +0200 Subject: [PATCH] fix path and IO redirection --- Dockerfile | 2 +- update | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c70506c..c6ee901 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/update b/update index 6e3eda9..827b2e5 100755 --- a/update +++ b/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"