diff options
| author | KunoiSayami <[email protected]> | 2023-06-10 04:21:32 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2023-06-10 04:21:32 +0800 |
| commit | 496086b8f378d542b6d92ed63d9f16360da0c8f3 (patch) | |
| tree | 5af86c3a9954ab932bb311ea75977ed29d35757d | |
| parent | c0fe39ebcef6294be5ff49e0e2c7c13343ee69c6 (diff) | |
feat(build): Add a way to check directory is empty
Signed-off-by: KunoiSayami <[email protected]>
| -rwxr-xr-x | docker/dockerbuild.sh | 2 | ||||
| -rw-r--r-- | docker/dockerfile | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/docker/dockerbuild.sh b/docker/dockerbuild.sh index 00b2250..52a9851 100755 --- a/docker/dockerbuild.sh +++ b/docker/dockerbuild.sh @@ -4,7 +4,7 @@ set -Eeuo pipefail sudo pacman -Sy cd /home/build -if [ ! -d repos ]; then +if [ ! -d repos ] || [ $(ls -A repos) ]; then git clone --depth=3 https://github.com/kunoisayami/repos diff --git a/docker/dockerfile b/docker/dockerfile index d771945..13a79f7 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -16,7 +16,7 @@ RUN pacman-key --lsign-key 4A0F0C8BC709ACA4341767FB243975C8DB9656B9 RUN useradd -m build -COPY dockerbuild.sh initfolder.sh hook.sh* /home/build/ +COPY initfolder.sh hook.sh* /home/build/ RUN if [ -r /home/build/hook.sh ]; then /home/build/hook.sh; fi @@ -34,6 +34,8 @@ RUN echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers ADD repos /home/build/repos +COPY dockerbuild.sh /home/build/ + RUN /home/build/initfolder.sh USER build |
