Last active
July 1, 2025 09:57
-
-
Save wfouche/af1a14982d0edf9a386f7c1a41fb338b to your computer and use it in GitHub Desktop.
Show newers versions of JBang //DEPS
This file contains hidden or 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
| import json, os, sys | |
| os.system("jbang info tools %s > jbang-deps.json"%(sys.argv[1])) | |
| file = open("jbang-deps.json") | |
| d = json.load(file) | |
| file.close() | |
| os.unlink("jbang-deps.json") | |
| os.system("jbang toolbox@maveniverse versions " + ",".join(d["dependencies"])) |
Author
Author
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.asciidoctor:asciidoctorj:3.0.0
//DEPS org.asciidoctor:asciidoctorj-diagram:2.3.1
//DEPS org.asciidoctor:asciidoctorj-diagram-plantuml:1.2025.2
import org.asciidoctor.Asciidoctor;
import org.asciidoctor.Options;
import org.asciidoctor.SafeMode;
import java.io.File;
public class asciidoc {
public static void main(String[] args) {
Asciidoctor asciidoctor = Asciidoctor.Factory.create();
asciidoctor.requireLibrary("asciidoctor-diagram");
asciidoctor.convertFile(
new File(args[0]),
Options.builder()
.toFile(true)
.safe(SafeMode.UNSAFE)
.build());
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jbang run jython-cli@jython jbang-deps.py asciidoc.javapython3 jbang-deps.py asciidoc.java