aboutsummaryrefslogtreecommitdiff
path: root/licentia/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--licentia/source/program/licentia.lux16
1 files changed, 7 insertions, 9 deletions
diff --git a/licentia/source/program/licentia.lux b/licentia/source/program/licentia.lux
index f1a1503b4..44babb828 100644
--- a/licentia/source/program/licentia.lux
+++ b/licentia/source/program/licentia.lux
@@ -36,7 +36,7 @@
[format
["." json]]]
[world
- ["." file (#+ Path File)]]]
+ ["." file]]]
["." / #_
["#." input]
["#." output]])
@@ -49,10 +49,11 @@
["#::."
(trim [] java/lang/String)])
-(def: default_output_file "LICENSE")
+(def: default_output_file
+ "LICENSE.txt")
(def: (success_message output)
- (-> Path Text)
+ (-> file.Path Text)
(format "Your license has been made!" text.new_line
"Check the file " output "."))
@@ -62,8 +63,7 @@
(do io.monad
[?done (: (IO (Try Any))
(do (try.with io.monad)
- [file (!.use (\ file.default file) [input])
- blob (!.use (\ file content) [])
+ [blob (\ file.default read input)
document (io\wrap (do {! try.monad}
[raw_json (\ utf8.codec decode blob)
json (|> raw_json
@@ -71,10 +71,8 @@
(\ json.codec decode))]
(|> json
(<json>.run /input.license)
- (\ ! map /output.license))))
- output_file (: (IO (Try (File IO)))
- (file.get_file io.monad file.default output))]
- (!.use (\ output_file over_write) (\ utf8.codec encode document))))]
+ (\ ! map /output.license))))]
+ (\ file.default write (\ utf8.codec encode document) output)))]
(wrap (debug.log! (case ?done
(#try.Success _)
(success_message output)