Skip to content

let the user define the location of global directory by setting environment variables #14

@nopid

Description

@nopid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions