aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/world/shell.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/world/shell.lux')
-rw-r--r--stdlib/source/library/lux/world/shell.lux84
1 files changed, 42 insertions, 42 deletions
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux
index cba2e4d7e..22f63e05b 100644
--- a/stdlib/source/library/lux/world/shell.lux
+++ b/stdlib/source/library/lux/world/shell.lux
@@ -1,37 +1,37 @@
(.using
- [library
- [lux "*"
- ["@" target]
- ["jvm" ffi {"+" import:}]
- [abstract
- [monad {"+" do}]]
- [control
- ["[0]" function]
- ["[0]" try {"+" Try}]
- ["[0]" exception {"+" exception:}]
- ["[0]" io {"+" IO}]
- [security
- ["?" policy {"+" Context Safety Safe}]]
- [concurrency
- ["[0]" atom {"+" Atom}]
- ["[0]" async {"+" Async}]]
- [parser
- [environment {"+" Environment}]]]
- [data
- ["[0]" product]
- ["[0]" text
- ["%" format {"+" format}]
- [encoding
- ["[0]" utf8]]]
- [collection
- ["[0]" array {"+" Array}]
- ["[0]" list ("[1]#[0]" mix functor)]
- ["[0]" dictionary]]]
- [math
- [number {"+" hex}
- ["n" nat]]]]]
- [//
- [file {"+" Path}]])
+ [library
+ [lux "*"
+ ["@" target]
+ ["[0]" ffi {"+" import:}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" function]
+ ["[0]" try {"+" Try}]
+ ["[0]" exception {"+" exception:}]
+ ["[0]" io {"+" IO}]
+ [security
+ ["?" policy {"+" Context Safety Safe}]]
+ [concurrency
+ ["[0]" atom {"+" Atom}]
+ ["[0]" async {"+" Async}]]
+ [parser
+ [environment {"+" Environment}]]]
+ [data
+ ["[0]" product]
+ ["[0]" text
+ ["%" format {"+" format}]
+ [encoding
+ ["[0]" utf8]]]
+ [collection
+ ["[0]" array {"+" Array}]
+ ["[0]" list ("[1]#[0]" mix functor)]
+ ["[0]" dictionary]]]
+ [math
+ [number {"+" hex}
+ ["n" nat]]]]]
+ [//
+ [file {"+" Path}]])
(type: .public Exit
Int)
@@ -178,10 +178,10 @@
(-> (List Argument) (Array java/lang/String))
(product.right
(list#mix (function (_ argument [idx output])
- [(++ idx) (jvm.write! idx
- (:as java/lang/String argument)
+ [(++ idx) (ffi.write! idx
+ (ffi.as_string argument)
output)])
- [0 (jvm.array java/lang/String (list.size arguments))]
+ [0 (ffi.array java/lang/String (list.size arguments))]
arguments)))
(import: (java/util/Map k v)
@@ -250,7 +250,7 @@
[output (java/io/BufferedReader::readLine <stream>)]
(case output
{.#Some output}
- (in output)
+ (in (ffi.of_string output))
{.#None}
(# io.monad in (exception.except ..no_more_output [])))))]
@@ -262,10 +262,10 @@
(java/io/OutputStream::write (# utf8.codec encoded message) jvm_output))
(~~ (template [<name> <method>]
[(def: (<name> _)
- (<method> process))]
+ (|> process <method>))]
[destroy java/lang/Process::destroy]
- [await java/lang/Process::waitFor]
+ [await (<| (# ! each (|>> ffi.of_int)) java/lang/Process::waitFor)]
))))))))
(import: java/io/File
@@ -287,8 +287,8 @@
(def: windows?
(IO (Try Bit))
(# (try.with io.monad) each
- (|>> java/lang/String::toLowerCase (text.starts_with? "windows"))
- (java/lang/System::getProperty "os.name")))
+ (|>> java/lang/String::toLowerCase ffi.of_string (text.starts_with? "windows"))
+ (java/lang/System::getProperty (ffi.as_string "os.name"))))
(implementation: .public default
(Shell IO)
@@ -298,7 +298,7 @@
[.let [builder (|> (list& the_command arguments)
..jvm::arguments_array
java/lang/ProcessBuilder::new
- (java/lang/ProcessBuilder::directory (java/io/File::new working_directory)))]
+ (java/lang/ProcessBuilder::directory (java/io/File::new (ffi.as_string working_directory))))]
_ (|> builder
java/lang/ProcessBuilder::environment
(# try.functor each (..jvm::load_environment environment))