aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source')
-rw-r--r--new-luxc/source/luxc/io.jvm.lux15
1 files changed, 9 insertions, 6 deletions
diff --git a/new-luxc/source/luxc/io.jvm.lux b/new-luxc/source/luxc/io.jvm.lux
index d0e09a5b9..f3e8eacee 100644
--- a/new-luxc/source/luxc/io.jvm.lux
+++ b/new-luxc/source/luxc/io.jvm.lux
@@ -32,7 +32,8 @@
(listFiles [] #io #try (Array java/io/File))
(getAbsolutePath [] #io #try String)
(isFile [] #io #try boolean)
- (isDirectory [] #io #try boolean))
+ (isDirectory [] #io #try boolean)
+ (#static separator String))
(host.import java/lang/AutoCloseable
(close [] #io #try void))
@@ -55,7 +56,7 @@
(#.Cons dir dirs')
(do io.Monad<Process>
- [#let [file (format dir "/" path)]
+ [#let [file (format dir java/io/File::separator path)]
? (file-exists? file)]
(if ?
(wrap [path file])
@@ -104,8 +105,10 @@
(def: (platform-target root-target)
(-> File File)
- (format root-target "/" (for {"JVM" "jvm"
- "JS" "js"})))
+ (format root-target
+ java/io/File::separator
+ (for {"JVM" "jvm"
+ "JS" "js"})))
(def: #export (prepare-target target-dir)
(-> File (T.Task Unit))
@@ -117,11 +120,11 @@
(def: #export (prepare-module target-dir module-name)
(-> File Text (T.Task Unit))
(do T.Monad<Task>
- [_ (file.make-dir (format (platform-target target-dir) "/" module-name))]
+ [_ (file.make-dir (format (platform-target target-dir) java/io/File::separator module-name))]
(wrap [])))
(def: #export (write-file target-dir file-name content)
(-> File Text Blob (T.Task Unit))
(|> file-name
- (format (platform-target target-dir) "/")
+ (format (platform-target target-dir) java/io/File::separator)
(file.write content)))