diff options
author | Eduardo Julian | 2017-12-01 19:26:20 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-12-01 19:26:20 -0400 |
commit | e8f0f43673891152ea33f149ac3f28828368e013 (patch) | |
tree | 92483121dd2ace62ce917d429bd5250d6dc2120b /new-luxc/source/luxc/io.jvm.lux | |
parent | 718a4272074121ed1adb90626076dcc5e9217b2c (diff) |
- Now using platform-specific path separators instead of "/".
Diffstat (limited to 'new-luxc/source/luxc/io.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/io.jvm.lux | 15 |
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))) |