aboutsummaryrefslogtreecommitdiff
path: root/licentia
diff options
context:
space:
mode:
authorEduardo Julian2021-07-12 00:03:36 -0400
committerEduardo Julian2021-07-12 00:03:36 -0400
commit86df87512966e8038d70624ab654262ce14a915c (patch)
treee96d6709c04e7f3fc77f9d9912b86ef34e9c7ef7 /licentia
parentabe24425ced15fd784ef6c62d6f186af72b491db (diff)
Better syntax for parallel-hierarchy imports.
Diffstat (limited to '')
-rw-r--r--licentia/commands.md6
-rw-r--r--licentia/project.lux4
-rw-r--r--licentia/source/program/licentia.lux16
3 files changed, 14 insertions, 12 deletions
diff --git a/licentia/commands.md b/licentia/commands.md
index b852e22cf..435a2fd57 100644
--- a/licentia/commands.md
+++ b/licentia/commands.md
@@ -1,4 +1,4 @@
-## Build
+# Build
```
## Develop
@@ -7,7 +7,7 @@ cd ~/lux/licentia/ \
&& lux auto build
```
-## Test
+# Test
```
## Develop
@@ -16,7 +16,7 @@ cd ~/lux/licentia/ \
&& lux auto test
```
-## Run
+# Run
```
## Re-generate Lux's license.
diff --git a/licentia/project.lux b/licentia/project.lux
index 9e8a3282f..6c31af881 100644
--- a/licentia/project.lux
+++ b/licentia/project.lux
@@ -9,6 +9,10 @@
#dependencies [["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT" "jar"]]
#compiler ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]
+ ## #compiler ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT" "js"]
+ ## #compiler ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT" "jar"]
+ ## #compiler ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT" "jar"]
+ ## #compiler ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]
#program "program/licentia"
#test "test/licentia"}
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)