[commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Fix Windows cleanup command line (31a3dc4)

git at git.haskell.org git at git.haskell.org
Thu Feb 21 15:08:52 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ghc-8.8-merges
Link       : http://ghc.haskell.org/trac/ghc/changeset/31a3dc43f9c6278210964988f09601f625af738a/ghc

>---------------------------------------------------------------

commit 31a3dc43f9c6278210964988f09601f625af738a
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Jan 23 10:09:49 2019 -0500

    gitlab-ci: Fix Windows cleanup command line
    
    Why is it so hard to delete a directory's contents without deleting the
    directory itself in Windows? This will forever remain a mystery.
    
    (cherry picked from commit 6da9f4c8df7a216234ef50104e400cdcbfbc1bd4)


>---------------------------------------------------------------

31a3dc43f9c6278210964988f09601f625af738a
 .gitlab-ci.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d739eff..2478d0d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -407,5 +407,8 @@ cleanup-windows:
     - set "BUILD_DIR=%BUILD_DIR:/=\%"
     - echo "Cleaning %BUILD_DIR%"
     - cd \GitLabRunner
-    - rmdir /S /Q %BUILD_DIR%/*
+    # This is way more complicated than it should be:
+    # See https://stackoverflow.com/questions/1965787
+    - del %BUILD_DIR%\* /F /Q
+    - for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p"
     - exit /b 0



More information about the ghc-commits mailing list