all repos — min @ 469cfaf63879d5a1e375f2e683f51949f86a1fd1

A small but practical concatenative programming language.

Tested upgrade script on tasks; fixed incorrect regexp.
h3rald h3rald@h3rald.com
Fri, 02 Feb 2024 16:06:42 +0100
commit

469cfaf63879d5a1e375f2e683f51949f86a1fd1

parent

947fa62f2bddff042481af7a92c6be789e017c8c

M tasks/_helpers.mintasks/_helpers.min

@@ -1,11 +1,1 @@

- -"min.yml" fread from-yaml :config -".env.yml" fread from-yaml :env - -( - symbol required - ('sym :prog ==>) - ( - (prog which "" ==) ("$# is not available" (prog) =% error 1 exit) when - ) -) ::+ "min.yml" fread from-yaml :config ".env.yml" fread from-yaml :env ( symbol required ('sym :prog ==>) ( (prog which "" ==) ("$# is not available" (prog) =% error 1 exit) when ) ) ::
M tasks/build.mintasks/build.min

@@ -1,137 +1,1 @@

-#!/usr/bin/env min - -"_helpers" require :helpers 'helpers import - -( - symbol cz - ('sym :stage 'sym :variant 'sym :target-os ==>) - ( - true :pack-result - (stage "^(release-nopack|dev)$" match?) - (false @pack-result) - when - "-d:release" :d-stage - (stage "dev" ==) - ("-d:dev" @d-stage) - when - " " :d-variant - "min" :o-variant - (variant length 0 >) ( - "-d:$# " (variant) =% @d-variant - "$#min" (variant) =% @o-variant - ) when - "nim" required - "Building $# - $# (x64)" (o-variant target-os) =% notice! - "" :musl - "musl-gcc" which :musl-gcc - (musl-gcc length 0 >) - ("--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc" @musl) - when - "nim c $# -d:ssl -d:useOpenSsl3 $# --opt:size --cpu:amd64 --os:$# $#-o:$# min" (d-stage musl target-os d-variant o-variant) =% puts ! pop - (pack-result) - ( - {} - target-os %os - config /version %version - o-variant %exe - pack - ) - when - ) -) :: -;; Builds and packs a min executable. - -#| Tasks |# - -( - symbol guide - (==>) - ( - "hastyscribe" required - "Building - guide" notice! - "hastyscribe Min_DeveloperGuide.md --field/version=$#" (version) =% !! - "cp Min_DeveloperGuide.htm site/output/guide.dev.html" !! - ) -) :: -;; Builds the developer guide. - -( - symbol site - (==>) - ( - "hastysite" required - "Building - site" notice! - "cd site && hastysite build && cd .." !! - ) -) :: -;; Builds the min site. - -( - symbol pack - (dict :vdata ==>) - ( - vdata /exe :exe - (vdata /os "windows" ==) ("$#.exe" (exe) =% @exe) when - "$exe:_v$version:_$os:_x64.zip" :fn - fn vdata dpairs % ":" "" replace @fn - "Compressing: $#" (fn) =% notice! - (exe) => fn zip - ) -) :: -;; Compresses a min executable. - -( - symbol vim - (==>) - ( - config /version :min-version - "tasks/data/min.vim" fread :template - timestamp "dd MMM YYYY" tformat :date - min-symbols ("||" !=) filter " " join :symbols - "min.vim" :out-file - "Building - min.vim" notice! - template ("date" date "version" min-version "symbols" symbols) =% out-file fwrite - ) -) :: -;; Generates the min.vim file. - -( - symbol docs - (==>) - ( - guide - site - ) -) :: -;; Generate the min development guide and site. - -( - symbol dev - (==>) - ("dev" "" os cz) -) :: -;; Builds min (dev version) on the current OS. -( - symbol default - (==>) - ("release-nopack" "" os cz) -) :: -;; Builds min on the current OS. -( - symbol linux - (==>) - ("" "" "linux" cz) -) :: -;; Builds min for Linux. -( - symbol macosx - (==>) - ("" "" "macosx" cz) -) :: -;; Builds min for macOS. -( - symbol windows - (==>) - ("" "" "windows" cz) -) :: -;; Builds min for Windows. +#!/usr/bin/env min "_helpers" require :helpers 'helpers import ( symbol cz ('sym :stage 'sym :variant 'sym :target-os ==>) ( true :pack-result (stage "^(release-nopack|dev)$" match?) (false @pack-result) when "-d:release" :d-stage (stage "dev" ==) ("-d:dev" @d-stage) when " " :d-variant "min" :o-variant (variant length 0 >) ( "-d:$# " (variant) =% @d-variant "$#min" (variant) =% @o-variant ) when "nim" required "Building $# - $# (x64)" (o-variant target-os) =% notice! "" :musl "musl-gcc" which :musl-gcc (musl-gcc length 0 >) ("--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc" @musl) when "nim c $# -d:ssl -d:useOpenSsl3 $# --opt:size --cpu:amd64 --os:$# $#-o:$# min" (d-stage musl target-os d-variant o-variant) =% puts ! pop (pack-result) ( {} target-os %os config /version %version o-variant %exe pack ) when ) ) :: ;; Builds and packs a min executable. #| Tasks |# ( symbol guide (==>) ( "hastyscribe" required "Building - guide" notice! "hastyscribe Min_DeveloperGuide.md --field/version=$#" (version) =% !! "cp Min_DeveloperGuide.htm site/output/guide.dev.html" !! ) ) :: ;; Builds the developer guide. ( symbol site (==>) ( "hastysite" required "Building - site" notice! "cd site && hastysite build && cd .." !! ) ) :: ;; Builds the min site. ( symbol pack (dict :vdata ==>) ( vdata /exe :exe (vdata /os "windows" ==) ("$#.exe" (exe) =% @exe) when "$exe:_v$version:_$os:_x64.zip" :fn fn vdata dpairs % ":" "" replace @fn "Compressing: $#" (fn) =% notice! (exe) => fn zip ) ) :: ;; Compresses a min executable. ( symbol vim (==>) ( config /version :min-version "tasks/data/min.vim" fread :template timestamp "dd MMM YYYY" tformat :date min-symbols ("||" !=) filter " " join :symbols "min.vim" :out-file "Building - min.vim" notice! template ("date" date "version" min-version "symbols" symbols) =% out-file fwrite ) ) :: ;; Generates the min.vim file. ( symbol docs (==>) ( guide site ) ) :: ;; Generate the min development guide and site. ( symbol dev (==>) ("dev" "" os cz) ) :: ;; Builds min (dev version) on the current OS. ( symbol default (==>) ("release-nopack" "" os cz) ) :: ;; Builds min on the current OS. ( symbol linux (==>) ("" "" "linux" cz) ) :: ;; Builds min for Linux. ( symbol macosx (==>) ("" "" "macosx" cz) ) :: ;; Builds min for macOS. ( symbol windows (==>) ("" "" "windows" cz) ) :: ;; Builds min for Windows.
M tasks/clean.mintasks/clean.min

@@ -1,15 +1,1 @@

-#!/usr/bin/env min - -#| Tasks |# - -( - symbol default - (==>) - ( - "Cleaning up build files" notice! - . ls ("(\/(mini|lite)?min|\.(htm|zip|exe))$" match?) filter :files - files 'rm foreach - "Done." notice! - ) -) :: -;; Deletes min build files +#!/usr/bin/env min #| Tasks |# ( symbol default (==>) ( "Cleaning up build files" notice! . ls ("(/(mini|lite)?min|\.(htm|zip|exe))$" match?) filter :files files 'rm foreach "Done." notice! ) ) :: ;; Deletes min build files
M tasks/github.mintasks/github.min

@@ -1,159 +1,1 @@

-#!/usr/bin/env min - -"_helpers" require :helpers 'helpers import - -"next-release.md" fread escape :release-body -"tasks/data/draft-release.json" fread :draft-release-template - -config /version :min-version -env /github-token :token -draft-release-template ("version" min-version "body" release-body) =% :draft-release-body - -{} - "application/vnd.github.v3+json" %Accept - "token $#" (token) =% %Authorization -:headers - -( - symbol handle-errors - (dict :response ==>) - ( - response to-json "response.json" fwrite - response /status :status - (status 300 >) ( - response /body from-json :body - body /message :message - status string @status - "Error $#: $#" (status message) =% error status int exit - ) when - ) -) :: -;; Handles HTTP errors. - -( - symbol gh-req - (dict :data ==> dict|quot :result) - ( - data /endpoint :endpoint - "api" :subdomain - (data 'subdomain dhas?) (data /subdomain @subdomain) when - "https://$#.github.com/repos/h3rald/min$#" (subdomain endpoint) =% :url - {} - url %url - data /method %method - (data 'headers dhas?) - (data /headers %headers) - (headers %headers) - if - (data 'body dhas?) (data /body %body) when - request :response - response /status :status - response /body :body - response handle-errors - (body length 0 >) (body from-json) ({}) if - @result - ) -) :: -;; Execute a request using the Github API. - -( - symbol get-assets - (dict :data ==> quot :result) - ( - data /id :id - {} - "/releases/$#/assets" (id) =% %endpoint - "GET" %method - gh-req @result - ) -) :: -;; Retrieve the assets from an existing Github release. - -( - symbol delete-assets - (dict :config ==>) - ( - config get-assets :assets - config /id :id - assets (/id) map :assets-ids - assets-ids ( - :asset - {} - "/releases/assets/$#" (asset) =% %endpoint - "DELETE" %method - gh-req pop - ) foreach - ) -) :: -;; Delete all assets from an existing Github release. - -#| Tasks |# - -( - symbol draft - (==>) - ( - {} - "/releases" %endpoint - "POST" %method - draft-release-body %body - gh-req /id string :id - ; Save Release ID to min.yml - config id %id to-yaml "min.yml" fwrite - "Draft release v$# ($#) created successfully" (min-version id) =% notice! - ) -) :: -;; Creates a new draft release on Github. - -( - symbol update - (==>) - ( - config /id :id - {} - "/releases/$#" (id) =% %endpoint - "PATCH" %method - draft-release-body %body - gh-req /id string :id - "Draft release v$# ($#) updated successfully" (min-version id) =% notice! - ) -) :: -;; Updates the text of the current draft Github release. - -( - symbol assets - (==>) - ( - config get-assets =assets - assets size :total - "are" :verb - (total 1 ==) ("is" @verb) when - "There $# $# assets in release v$#" (verb total min-version) =% notice! - assets (/name () cons "- $#" swap % notice!) foreach - ) -) :: -;; Retrieve a list of all the assets of the current draft Github release. - -( - symbol upload - (==>) - ( - config /id :id - config delete-assets - . ls ("\.zip$" match?) filter - ( - filename :file - "Uploading: $#" (file) =% notice! - file fread :body - headers "application/zip" %Content-Type :asset-headers - {} - "/releases/$#/assets?name=$#" (id file) =% %endpoint - asset-headers %headers - "uploads" %subdomain - "POST" %method - body %body - gh-req pop - ) foreach - ) -) :: -;; Uploads all assets to the current draft Github release, deleting any existing asset. +#!/usr/bin/env min "_helpers" require :helpers 'helpers import "next-release.md" fread escape :release-body "tasks/data/draft-release.json" fread :draft-release-template config /version :min-version env /github-token :token draft-release-template ("version" min-version "body" release-body) =% :draft-release-body {} "application/vnd.github.v3+json" %Accept "token $#" (token) =% %Authorization :headers ( symbol handle-errors (dict :response ==>) ( response to-json "response.json" fwrite response /status :status (status 300 >) ( response /body from-json :body body /message :message status string @status "Error $#: $#" (status message) =% error status int exit ) when ) ) :: ;; Handles HTTP errors. ( symbol gh-req (dict :data ==> dict|quot :result) ( data /endpoint :endpoint "api" :subdomain (data 'subdomain dhas?) (data /subdomain @subdomain) when "https://$#.github.com/repos/h3rald/min$#" (subdomain endpoint) =% :url {} url %url data /method %method (data 'headers dhas?) (data /headers %headers) (headers %headers) if (data 'body dhas?) (data /body %body) when request :response response /status :status response /body :body response handle-errors (body length 0 >) (body from-json) ({}) if @result ) ) :: ;; Execute a request using the Github API. ( symbol get-assets (dict :data ==> quot :result) ( data /id :id {} "/releases/$#/assets" (id) =% %endpoint "GET" %method gh-req @result ) ) :: ;; Retrieve the assets from an existing Github release. ( symbol delete-assets (dict :config ==>) ( config get-assets :assets config /id :id assets (/id) map :assets-ids assets-ids ( :asset {} "/releases/assets/$#" (asset) =% %endpoint "DELETE" %method gh-req pop ) foreach ) ) :: ;; Delete all assets from an existing Github release. #| Tasks |# ( symbol draft (==>) ( {} "/releases" %endpoint "POST" %method draft-release-body %body gh-req /id string :id ; Save Release ID to min.yml config id %id to-yaml "min.yml" fwrite "Draft release v$# ($#) created successfully" (min-version id) =% notice! ) ) :: ;; Creates a new draft release on Github. ( symbol update (==>) ( config /id :id {} "/releases/$#" (id) =% %endpoint "PATCH" %method draft-release-body %body gh-req /id string :id "Draft release v$# ($#) updated successfully" (min-version id) =% notice! ) ) :: ;; Updates the text of the current draft Github release. ( symbol assets (==>) ( config get-assets =assets assets size :total "are" :verb (total 1 ==) ("is" @verb) when "There $# $# assets in release v$#" (verb total min-version) =% notice! assets (/name () cons "- $#" swap % notice!) foreach ) ) :: ;; Retrieve a list of all the assets of the current draft Github release. ( symbol upload (==>) ( config /id :id config delete-assets . ls ("\.zip$" match?) filter ( filename :file "Uploading: $#" (file) =% notice! file fread :body headers "application/zip" %Content-Type :asset-headers {} "/releases/$#/assets?name=$#" (id file) =% %endpoint asset-headers %headers "uploads" %subdomain "POST" %method body %body gh-req pop ) foreach ) ) :: ;; Uploads all assets to the current draft Github release, deleting any existing asset.
M tasks/h3rald.mintasks/h3rald.min

@@ -1,39 +1,1 @@

-#!/usr/bin/env min - -"_helpers" require :helpers 'helpers import - -config /version :min-version -"Min_DeveloperGuide.htm" :guide-file -"../h3rald/assets/min/" guide-file suffix :h3rald-guide -"../h3rald/contents/min.md" :h3rald-min-md -"version:\s+\d+\.\d+\.\d+" :min-v-reg -"version: $#" (min-version) =% :min-v-rep - -( - symbol update - (==>) - ( - "Updating min Developer Guide and project on H3RALD.com..." notice! - guide-file h3rald-guide cp - h3rald-min-md fread min-v-reg min-v-rep replace :updated-contents - updated-contents h3rald-min-md fwrite - "Done." notice! - ) -) :: -;; Updates the min Developer Guide and project page on H3RALD.com - -( - symbol build - (==>) - ( - "git" required - "hastysite" required - "Pulling content and rebuilding H3RALD.com web site..." notice! - ; Assuming min and h3rald are siblings - .. cd "h3rald" cd - "git pull" !! - "hastysite build" !! - .. cd "min" cd - ) -) :: -;; Builds H3RALD.com web site +#!/usr/bin/env min "_helpers" require :helpers 'helpers import config /version :min-version "Min_DeveloperGuide.htm" :guide-file "../h3rald/assets/min/" guide-file suffix :h3rald-guide "../h3rald/contents/min.md" :h3rald-min-md "version:\s+\d+\.\d+\.\d+" :min-v-reg "version: $#" (min-version) =% :min-v-rep ( symbol update (==>) ( "Updating min Developer Guide and project on H3RALD.com..." notice! guide-file h3rald-guide cp h3rald-min-md fread min-v-reg min-v-rep replace :updated-contents updated-contents h3rald-min-md fwrite "Done." notice! ) ) :: ;; Updates the min Developer Guide and project page on H3RALD.com ( symbol build (==>) ( "git" required "hastysite" required "Pulling content and rebuilding H3RALD.com web site..." notice! ; Assuming min and h3rald are siblings .. cd "h3rald" cd "git pull" !! "hastysite build" !! .. cd "min" cd ) ) :: ;; Builds H3RALD.com web site
M tasks/help.mintasks/help.min

@@ -1,152 +1,1 @@

-"tasks/data/doc-snippets.json" fread from-json :snippets -"site/contents" ls ("reference-" match?) filter :src-files -"(?sm)\{#op\|\|([^|]+)\|\|([^|]+)\|\|([^|]+)\|\|(.+?)#\}" :op-regex -"(?sm)\{#sig\|\|([^|]+)\|\|([^#]+)#\}" :sig-regex -"(?sm)\{#alias\|\|([^|]+)\|\|([^#]+)#\}" :alias-regex -"(?sm)\{\{([^}]+)\}\}" :snippet-regex -"(?sm)\>( \>)*" :block-regex -"(?sm)%([^%]+)%" :title-regex -"(?sm)\{@[^@]+@\}" :incl-regex -"(?sm)`([^`]+)`" :code-regex - -( - symbol fix-name - (str :s ==> str :result) - ( - s - "&excl;" (pop "!") replace-apply - "&quot;" (pop "\"") replace-apply - "&#124;" (pop "|") replace-apply - "\[" (pop "") replace-apply - "\]" (pop "") replace-apply - "\(class:kwd\)" (pop "") replace-apply - "&gt;" (pop ">") replace-apply - "&lt;" (pop "<") replace-apply - "&apos;" (pop "'") replace-apply - "&ast;" (pop "*") replace-apply - @result - ) -) :: -;; Fixes names with special characters -( - symbol process-block-markup - (str :s ==> str :result) - ( - s - block-regex (pop "") replace-apply - title-regex (pop "") replace-apply - incl-regex (pop "") replace-apply - code-regex (1 get) replace-apply - @result - ) -) :: -;; Simplify block-level markup - -( - symbol process-snippets - (str :s ==> str :result) - ( - s snippet-regex ( - 1 get :id - snippets id dget - ) replace-apply @result - ) -) :: -;; Resolves documentation snippets. - -( - symbol process - (str :s ==> str :result) - ( - s process-snippets process-block-markup strip @result - ) -) :: -;; Processes documentation snippets and markup. - -( - symbol process-op - (quot :matches ==> dict :data) - ( - {} - matches 1 get process fix-name %name - matches 2 get process fix-name :input - matches 3 get process fix-name :output - "$# ==> $#" (input output) =% %signature - matches 4 get process %description - "symbol" %kind - @data - ) -) :: -;; Processes operator reference documentation. - -( - symbol process-alias - (quot :matches ==> dict :data) - ( - {} - matches 1 get process fix-name %name - matches 2 get :ref - "See $#" (ref) =% %description - "symbol" %kind - @data - ) -) :: -;; Processes alias reference documentation. - -( - symbol process-sig - (quot :matches ==> dict :data) - ( - {} - matches 1 get process fix-name %name - matches 2 get :ref - "See $#" (ref) =% %description - "sigil" %kind - @data - ) -) :: -;; Processes sigil reference documentation. - -( - symbol default - (==>) - ( - {} :ref-dict - {} :op-dict - {} :sig-dict - src-files ( - :file - file "reference-([a-z]+)\.md" search 1 get :mod-id - "Processing: $#" (mod-id) =% notice! - file fread :contents - contents op-regex search-all ( - process-op :op - op /name :op-name - op-dict - op op-name dset - @op-dict - ) foreach - contents alias-regex search-all ( - process-alias :alias - alias /name :alias-name - op-dict - alias alias-name dset - @op-dict - ) foreach - contents sig-regex search-all ( - process-sig :sig - sig /name :sig-name - sig-dict - sig sig-name dset - @sig-dict - ) foreach - ref-dict - op-dict %operators - sig-dict %sigils - @ref-dict - ) foreach - "Writing help.json" notice! - ref-dict to-json "help.json" fwrite - ) -) :: -;; Builds the reference help JSON sources. +"tasks/data/doc-snippets.json" fread from-json :snippets "site/contents" ls ("reference-" match?) filter :src-files "(?sm)\{#op\|\|([^|]+)\|\|([^|]+)\|\|([^|]+)\|\|(.+?)#\}" :op-regex "(?sm)\{#sig\|\|([^|]+)\|\|([^#]+)#\}" :sig-regex "(?sm)\{#alias\|\|([^|]+)\|\|([^#]+)#\}" :alias-regex "(?sm)\{\{([^}]+)\}\}" :snippet-regex "(?sm)\>( \>)*" :block-regex "(?sm)%([^%]+)%" :title-regex "(?sm)\{@[^@]+@\}" :incl-regex "(?sm)`([^`]+)`" :code-regex ( symbol fix-name (str :s ==> str :result) ( s "&excl;" (pop "!") replace-apply "&quot;" (pop "\"") replace-apply "&#124;" (pop "|") replace-apply "\[" (pop "") replace-apply "\]" (pop "") replace-apply "\(class:kwd\)" (pop "") replace-apply "&gt;" (pop ">") replace-apply "&lt;" (pop "<") replace-apply "&apos;" (pop "'") replace-apply "&ast;" (pop "*") replace-apply @result ) ) :: ;; Fixes names with special characters ( symbol process-block-markup (str :s ==> str :result) ( s block-regex (pop "") replace-apply title-regex (pop "") replace-apply incl-regex (pop "") replace-apply code-regex (1 get) replace-apply @result ) ) :: ;; Simplify block-level markup ( symbol process-snippets (str :s ==> str :result) ( s snippet-regex ( 1 get :id snippets id dget ) replace-apply @result ) ) :: ;; Resolves documentation snippets. ( symbol process (str :s ==> str :result) ( s process-snippets process-block-markup strip @result ) ) :: ;; Processes documentation snippets and markup. ( symbol process-op (quot :matches ==> dict :data) ( {} matches 1 get process fix-name %name matches 2 get process fix-name :input matches 3 get process fix-name :output "$# ==> $#" (input output) =% %signature matches 4 get process %description "symbol" %kind @data ) ) :: ;; Processes operator reference documentation. ( symbol process-alias (quot :matches ==> dict :data) ( {} matches 1 get process fix-name %name matches 2 get :ref "See $#" (ref) =% %description "symbol" %kind @data ) ) :: ;; Processes alias reference documentation. ( symbol process-sig (quot :matches ==> dict :data) ( {} matches 1 get process fix-name %name matches 2 get :ref "See $#" (ref) =% %description "sigil" %kind @data ) ) :: ;; Processes sigil reference documentation. ( symbol default (==>) ( {} :ref-dict {} :op-dict {} :sig-dict src-files ( :file file "reference-([a-z]+)\.md" search 1 get :mod-id "Processing: $#" (mod-id) =% notice! file fread :contents contents op-regex search-all ( process-op :op op /name :op-name op-dict op op-name dset @op-dict ) foreach contents alias-regex search-all ( process-alias :alias alias /name :alias-name op-dict alias alias-name dset @op-dict ) foreach contents sig-regex search-all ( process-sig :sig sig /name :sig-name sig-dict sig sig-name dset @sig-dict ) foreach ref-dict op-dict %operators sig-dict %sigils @ref-dict ) foreach "Writing help.json" notice! ref-dict to-json "help.json" fwrite ) ) :: ;; Builds the reference help JSON sources.
M tasks/release.mintasks/release.min

@@ -1,21 +1,1 @@

-#!/usr/bin/env min - -"build" require :build -"github" require :github - -#| Tasks |# -( - symbol default - (==>) - ( - *build/guide - *build/site - *build/vim - *build/windows - *build/linux - *build/macosx - *github/update - *github/upload - ) -) :: -;; Builds min executables and updates the current draft Github release. +#!/usr/bin/env min "build" require :build "github" require :github #| Tasks |# ( symbol default (==>) ( *build/guide *build/site *build/vim *build/windows *build/linux *build/macosx *github/update *github/upload ) ) :: ;; Builds min executables and updates the current draft Github release.
M tasks/version.mintasks/version.min

@@ -1,80 +1,1 @@

-#!/usr/bin/env min - -"min.yml" :yaml-cfg -"site/settings.json" :json-site-cfg - -yaml-cfg fread from-yaml :config -config /version :old-version - -( - symbol update-yaml-config - ('sym :new-version ==>) - ( - config new-version %version @config - config to-yaml yaml-cfg fwrite - ) -) :: -;; Sets the version in the min.yml file to new-version. - -( - symbol update-site-config - ('sym :new-version ==>) - ( - json-site-cfg fread from-json :site-config - site-config new-version %version @site-config - site-config to-json json-site-cfg fwrite - ) -) :: -;; Updates the version of the web site to new-version. - -#| Tasks |# - -( - symbol set - (==>) - ( - "" :new-version - false :valid-semver - (valid-semver not) - ( - "New version" ask @new-version - new-version semver? @valid-semver - ) while - new-version update-yaml-config - new-version update-site-config - ) -) :: -;; Asks and sets the new min version where appropriate. - -( - symbol major - (==>) - ( - old-version semver-inc-major :new-version - new-version update-yaml-config - new-version update-site-config - ) -) :: -;; Increments the min major version. - -( - symbol minor - (==>) - ( - old-version semver-inc-minor :new-version - new-version update-yaml-config - new-version update-site-config - ) -) :: -;; Increments the min minor version. - -( - symbol patch - (==>) - ( - old-version semver-inc-patch :new-version - new-version update-yaml-config - new-version update-site-config - ) -) :: -;; Increments the min patch version. +#!/usr/bin/env min "min.yml" :yaml-cfg "site/settings.json" :json-site-cfg yaml-cfg fread from-yaml :config config /version :old-version ( symbol update-yaml-config ('sym :new-version ==>) ( config new-version %version @config config to-yaml yaml-cfg fwrite ) ) :: ;; Sets the version in the min.yml file to new-version. ( symbol update-site-config ('sym :new-version ==>) ( json-site-cfg fread from-json :site-config site-config new-version %version @site-config site-config to-json json-site-cfg fwrite ) ) :: ;; Updates the version of the web site to new-version. #| Tasks |# ( symbol set (==>) ( "" :new-version false :valid-semver (valid-semver not) ( "New version" ask @new-version new-version semver? @valid-semver ) while new-version update-yaml-config new-version update-site-config ) ) :: ;; Asks and sets the new min version where appropriate. ( symbol major (==>) ( old-version semver-inc-major :new-version new-version update-yaml-config new-version update-site-config ) ) :: ;; Increments the min major version. ( symbol minor (==>) ( old-version semver-inc-minor :new-version new-version update-yaml-config new-version update-site-config ) ) :: ;; Increments the min minor version. ( symbol patch (==>) ( old-version semver-inc-patch :new-version new-version update-yaml-config new-version update-site-config ) ) :: ;; Increments the min patch version.