Skip to content

Commit

Permalink
fixed write
Browse files Browse the repository at this point in the history
  • Loading branch information
drkameleon committed Nov 28, 2024
1 parent a781f2e commit 892bdac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
6 changes: 3 additions & 3 deletions tools/deploy.art
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ do ::
targetFolder: "packages"

infoD: getRepoInfo pkg
write ~"|targetFolder|/info/|targetName|" as.unwrapped.pretty.code infoD
write as.unwrapped.pretty.code infoD ~"|targetFolder|/info/|targetName|"

versionD: getVersions pkg
write ~"|targetFolder|/version/|targetName|" as.pretty.code versionD
write as.pretty.code versionD ~"|targetFolder|/version/|targetName|"

print color #green "[ ✅ OK ]"

Expand All @@ -50,7 +50,7 @@ do ::
cnt: cnt + 1
]

write ~"public/list.art" as.unwrapped.pretty.code listWithDescriptions
write as.unwrapped.pretty.code listWithDescriptions ~"public/list.art"

print separator
print ""
Expand Down
31 changes: 16 additions & 15 deletions tools/generateweb.art
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ compressCSS: function [file][
]

getProperMarkdown: function [md][
write "tmp.md" md
md >> "tmp.md"
ret: execute ~{ruby |relative "gfm.rb"| tmp.md}
; print ["Got:\n" ret]
; ret: read.markdown md
Expand Down Expand Up @@ -156,7 +156,7 @@ createSpecFile: function [package, versionToProcess, targetFolder][
requires: versionToProcess\info\requires
]

write ~"|targetFolder|/spec" replace strip as.pretty.unwrapped.code ret {/\[\n\n\s+\]/} "[]"
write replace strip as.pretty.unwrapped.code ret {/\[\n\n\s+\]/} "[]" ~"|targetFolder|/spec"
]

searchable: new []
Expand All @@ -165,7 +165,7 @@ searchable: new []

thumbsFolder: "public/thumbs"
unless directory? thumbsFolder [
write.directory "public/thumbs" ø
write.directory ø "public/thumbs"
]

loop packages [k,v][
Expand Down Expand Up @@ -198,23 +198,23 @@ processPackagePage: function [entry][
postprocessHTML render.template read "website/package.html" entry\info\fullName
]

searchable: write.compact.json ø searchable
searchable: write.compact.json searchable ø

pkgFolder: "public/_packages"
unless directory? pkgFolder [
write.directory pkgFolder ø
write.directory ø pkgFolder
]

loop entries 'entry [
print ~"- Creating subpages: |entry\name|"
tgtName: ~{|pkgFolder|/|entry\name|}
unless directory? tgtName [
write.directory tgtName ø
write.directory ø tgtName
]

currentVersion: first entry\version
currentVersionIsLatest: true
write ~{|tgtName|/index.html} processPackagePage entry
write processPackagePage entry ~{|tgtName|/index.html}
compressHTML ~{|tgtName|/index.html}

createSpecFile entry currentVersion tgtName
Expand All @@ -223,15 +223,15 @@ loop entries 'entry [
versionTgt: ~{|tgtName|/|vv\version|}
print ~"\t|vv\version|"
unless directory? versionTgt [
write.directory versionTgt ø
write.directory ø versionTgt
]

currentVersion: vv
currentVersionIsLatest: false
if currentVersion = first entry\version ->
currentVersionIsLatest: true

write ~{|versionTgt|/index.html} processPackagePage entry
write processPackagePage entry ~{|versionTgt|/index.html}
compressHTML ~{|versionTgt|/index.html}

createSpecFile entry vv versionTgt
Expand All @@ -249,28 +249,29 @@ if odd? size entries ->
isHome: true
isSearch: false
packageTitle: ""
write "public/index.html"
render.template read "website/index.html"
write render.template read "website/index.html" "public/index.html"


; and compress it
compressHTML "public/index.html"

; render search page
isHome: false
isSearch: true
write.directory "public/search" ø
write.directory ø "public/search"
if null? last entries ->
pop 'entries
write "public/search/index.html"
render.template read "website/search.html"
write render.template read "website/search.html"
"public/search/index.html"


; and compress it too
compressHTML "public/search/index.html"

; create assets folder if necessary
assetsFolder: "public/assets"
unless directory? assetsFolder [
write.directory assetsFolder ø
write.directory ø assetsFolder
]

; compile scss
Expand Down
2 changes: 1 addition & 1 deletion tools/getrepodetails.art
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ getRepoInfo: function [pkg][

getReleaseInfo: function [owner, repo, version, url][
if IsCI? [
write.directory "tmp" ø
write.directory ø "tmp"
]

tgt: ~{tmp/|owner|-|repo|-|version|.zip}
Expand Down

0 comments on commit 892bdac

Please sign in to comment.