From 951796aeb704dc1984db330f3df549e52641b205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 12 Jun 2018 10:03:56 +0300 Subject: [PATCH] extract-docker: Remove leading slashes when removing an earlier copy If extracting from an absolute path within the image, like /opt/llvm-mingw, it will still be extracted into opt/llvm-mingw in the local directory. --- extract-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extract-docker.sh b/extract-docker.sh index 53c4927..f4c10ea 100755 --- a/extract-docker.sh +++ b/extract-docker.sh @@ -12,5 +12,5 @@ fi image=$1 dir=$2 -rm -rf $dir +rm -rf $(echo $dir | sed 's,^/,,') docker run --rm $image tar -cf - $dir | tar -xvf -