Skip to content

Commit 9c33a08

Browse files
authored
Add JabRef cloning command (#13157)
1 parent daf5a20 commit 9c33a08

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.jbang/CloneJabRef.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import java.nio.file.Files;
2+
import java.nio.file.Path;
3+
4+
///usr/bin/env jbang "$0" "$@" ; exit $?
5+
6+
//JAVA 24
7+
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
8+
9+
//DEPS org.eclipse.jgit:org.eclipse.jgit.pgm:7.2.1.202505142326-r
10+
11+
public class CloneJabRef {
12+
public static void main(String[] noArgs) throws Exception {
13+
Path targetDir = Path.of(System.getProperty("java.io.tmpdir"), "JabRef");
14+
if (Files.exists(targetDir)) {
15+
System.out.println("Directory already exists: " + targetDir);
16+
return;
17+
}
18+
19+
String[] args = {"clone", "https://github.com/JabRef/jabref.git", "--recurse-submodules", targetDir.toString()};
20+
org.eclipse.jgit.pgm.Main.main(args);
21+
22+
System.out.println("JabRef code available at: " + targetDir);
23+
}
24+
}

0 commit comments

Comments
 (0)