Skip to content

Commit

Permalink
MERGE: #92
Browse files Browse the repository at this point in the history
92: REPL: use AYA_HOME to configure the CONFIG_ROOT r=ice1000 a=Glavo

kala-platform is part of the kala project and is planned to handle platform-related operations.

`Platform::getAppDataDirectory(String)` currently tries to locate the program folder like this:

* Use `%APPDATA%\$name` on Windows.
* Use `~/Library/Application Support/$name` on Mac OS.
* Use `$XDG_DATA_HOME/$name` as the preferred path, and the alternative path is `~/.local/share/$name`.

Co-authored-by: Glavo <zjx001202@gmail.com>
  • Loading branch information
bors[bot] and Glavo authored Oct 18, 2021
2 parents 215c553 + 6c2d7cc commit 1747794
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/src/main/java/org/aya/cli/repl/Repl.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@

public class Repl {
private static Path CONFIG_ROOT;

static @Nullable Path configRoot() {
if (CONFIG_ROOT == null) {
CONFIG_ROOT = Paths.get(System.getProperty("user.home"), ".aya");
String ayaHome = System.getenv("AYA_HOME");
CONFIG_ROOT = ayaHome == null ? Paths.get(System.getProperty("user.home"), ".aya") : Paths.get(ayaHome);
}
try {
Files.createDirectories(CONFIG_ROOT);
Expand Down

0 comments on commit 1747794

Please sign in to comment.