-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
#!/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 stdlib = trust file_glob("/tmp/amber-git/amber-master/src/std/**.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 docs --usage -- "{v}" "./docs/stdlib/doc/" $ | ||
echo "\n" | ||
} | ||
} |