... The licenses produced by this program are inspired by: ... Apache License (Version 2.0): https://www.apache.org/licenses/LICENSE-2.0 ... Mozilla Public License (Version 2.0): https://www.mozilla.org/en-US/MPL/2.0/ ... MIT/Expat License: https://opensource.org/licenses/MIT ... BSD licenses: https://en.wikipedia.org/wiki/BSD_licenses ... Commons Clause: https://commonsclause.com/ ... Reciprocal Public License 1.5 (RPL-1.5): https://opensource.org/licenses/RPL-1.5 ... The Parity Public License: https://licensezero.com/licenses/parity ... The Charity Public License: https://licensezero.com/licenses/charity ... Lerna black-list: https://github.com/lerna/lerna/pull/1616 ... Common Public Attribution License Version 1.0 (CPAL-1.0): https://opensource.org/licenses/CPAL-1.0 ... Eclipse Public License v2.0: https://www.eclipse.org/legal/epl-2.0/ (.require [library [lux (.except) [ffi (.only import)] ["[0]" debug] [abstract [monad (.only do)]] [control [remember (.only to_do)] ["[0]" io (.only IO) (.use "[1]#[0]" monad)] ["[0]" maybe] ["[0]" try (.only Try)] ["[0]" parser] [security ["!" capability]]] [data ["[0]" text ["%" \\format (.only format)] [encoding ["[0]" utf8]]] [format ["[0]" json (.only) ["<[1]>" \\parser (.only Parser)]]]] ["[0]" program (.only program) ["<[1]>" \\parser]] [world ["[0]" file]]]] ["[0]" / ["[1][0]" input] ["[1][0]" output]]) (with_expansions [ "2022-04-01"] (to_do "Create a short notice to add as a comment to each file in the _.work")) (import java/lang/String "[1]::[0]" (trim [] java/lang/String)) (def default_output_file "LICENSE.txt") (def (success_message output) (-> file.Path Text) (format "Your license has been made!" text.new_line "Check the file " output ".")) (def _ (program [input (<| (.named "--input") .any) output (<| (parser.default ..default_output_file) (.named "--output") .any)] (do io.monad [?done (is (IO (Try Any)) (do (try.with io.monad) [blob (of file.default read input) document (io#wrap (do [! try.monad] [raw_json (of utf8.codec decoded blob) json (|> raw_json java/lang/String::trim (of json.codec decoded))] (|> json (.result /input.license) (of ! each /output.license))))] (of file.default write (of utf8.codec encoded document) output)))] (wrap (debug.log! (when ?done {try.#Success _} (success_message output) {try.#Failure message} message))))))