[commit: ghc] wip/T16087, wip/T16254, wip/junit-unexpected-passes: gitlab-ci: Fix Windows cleanup command line (6da9f4c)

git at git.haskell.org git at git.haskell.org
Wed Jan 30 00:25:51 UTC 2019


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

On branches: wip/T16087,wip/T16254,wip/junit-unexpected-passes
Link       : http://ghc.haskell.org/trac/ghc/changeset/6da9f4c8df7a216234ef50104e400cdcbfbc1bd4/ghc

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

commit 6da9f4c8df7a216234ef50104e400cdcbfbc1bd4
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.


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

6da9f4c8df7a216234ef50104e400cdcbfbc1bd4
 .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