]> gitweb.factorcode.org Git - factor.git/commitdiff
build-from-source: Fix delete and add find-dlls
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 15 Jan 2023 20:24:09 +0000 (14:24 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 15 Jan 2023 20:26:17 +0000 (14:26 -0600)
extra/build-from-source/build-from-source.factor

index 7315a9b521c4a25dda00699226f537c36f3331ab..275bc7844f73b4d2c299aa40b8e1dcc097cc7ef3 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2023 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: cli.git combinators.short-circuit formatting http.client
-io.directories io.files io.files.info io.files.temp io.launcher
-io.pathnames kernel layouts namespaces sequences splitting
-system ;
+USING: ascii cli.git combinators.short-circuit formatting
+http.client io.directories io.files io.files.info io.files.temp
+io.launcher io.pathnames kernel layouts namespaces sequences
+splitting system ;
 IN: build-from-source
 
 : dll-out-directory ( -- path )
@@ -16,10 +16,18 @@ IN: build-from-source
 : prepend-current-path ( path -- path' )
     current-directory get prepend-path ;
 
+: find-dlls ( path -- paths )
+    recursive-directory-files
+    [ file-name >lower ".dll" tail? ] filter ;
+
 : copy-output-file-as ( name new-name -- )
     [ prepend-current-path ]
     [ dll-out-directory prepend-path ] bi* copy-file ;
 
+: copy-vm-file-as ( name new-name -- )
+    [ prepend-current-path ]
+    [ vm-path parent-directory prepend-path ] bi* copy-file ;
+
 : copy-output-file ( name -- )
     prepend-current-path dll-out-directory copy-file-into ;
 
@@ -38,7 +46,7 @@ IN: build-from-source
 ! C:\Users\sheeple\AppData\Local\Temp\factorcode.org\Factor>
 : ?sync-repository-as ( url path -- )
     dup { [ git-directory? ] [ ".git" append-path empty-directory? not ] } 1&&
-    [ dup delete-tree ] unless
+    [ dup ?delete-tree ] unless
     sync-repository-as wait-for-success ;
 
 : with-updated-git-repo-as ( git-uri path quot -- )