Skip to content

Commit

Permalink
Update sync-stdlib-doc to v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Dec 19, 2024
1 parent bfc9e7f commit c7571c6
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions sync-stdlib-doc.ab
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#!/usr/bin/env amber
import { download } from "std/http"
import { split, contains } from "std/text"
import { file_exist } from "std/fs"
import { file_download } from "std/http"
import { split, text_contains } from "std/text"
import { file_extract, file_glob } from "std/fs"

trust $rm -fr /tmp/amber-git$
if silent download("https://github.com/amber-lang/amber/archive/refs/heads/master.zip", "/tmp/amber-git.zip") {
trust $unzip "/tmp/amber-git.zip" -d /tmp/amber-git$
let std_path = "/tmp/amber-git/amber-master/src/std/"
if silent file_download("https://github.com/amber-lang/amber/archive/refs/heads/master.zip", "/tmp/amber-git.zip") {
trust file_extract("/tmp/amber-git.zip", "/tmp/amber-git")
const std_path = "/tmp/amber-git/amber-master/src/std/"
const stdlib = trust file_glob("{std_path}/**.ab")

let std = trust $/usr/bin/ls "{std_path}"$
let stdlib = split(std, "\n")

loop v in stdlib {
if (contains(v, ".ab") and file_exist("{std_path}{v}")) {
echo "Parsing {std_path}{v}"
trust $amber --docs "{std_path}{v}" "./docs/stdlib/doc/"$
echo "\n"
}
for v in stdlib {
echo "Parsing {v}"
trust $ amber-staging docs --usage -- "{v}" "./docs/stdlib/doc/" $
echo "\n"
}
}

0 comments on commit c7571c6

Please sign in to comment.