Walnut needs a main directory where artifacts are stored. By default, it is the current directory or the directory below if bin.
|
public static void setPathsAndNames() { |
|
String path = System.getProperty("user.dir"); |
|
if (path.endsWith("bin")) |
|
mainWalnutDir = "../"; |
|
name = SESSION_NAME + "/" + |
|
LocalDateTime.now().format(DateTimeFormatter.ofPattern(FRIENDLY_DATE_TIME_PATTERN)) + "/"; |
|
if (sessionWalnutDir == null) { |
|
sessionWalnutDir = mainWalnutDir + name; |
|
} |
|
createSubdirectories(); |
|
} |
In the Walnut Jupyter kernel, I have been using environment variables to specify where Walnut is located:
WALNUT_HOME is the main directory location;
WALNUT_JAR is the main jar file location.
Basically, the kernel launches a process that runs something like
cd $WALNUT_HOME
java -Xmx$WALNUT_MEM -jar $WALNUT_JAR
Proposal for improvement: let the user specify the Walnut main directory by setting the WALNUT_HOME environment variable as the default location for the main directory. If set, this variable would be used as the default value for mainWalnutDir.
This will allow users to install Walnut where they want and have Walnut find it on startup.
Walnut needs a main directory where artifacts are stored. By default, it is the current directory or the directory below if
bin.Walnut/src/main/java/Main/Session.java
Lines 48 to 58 in dc63950
In the Walnut Jupyter kernel, I have been using environment variables to specify where Walnut is located:
WALNUT_HOMEis the main directory location;WALNUT_JARis the main jar file location.Basically, the kernel launches a process that runs something like
Proposal for improvement: let the user specify the Walnut main directory by setting the
WALNUT_HOMEenvironment variable as the default location for the main directory. If set, this variable would be used as the default value formainWalnutDir.This will allow users to install Walnut where they want and have Walnut find it on startup.