feat: allow custom user data directory via DATA_DIR environment variable
This commit is contained in:
parent
4cf25dc53d
commit
d83bd86816
2 changed files with 4 additions and 0 deletions
|
|
@ -66,6 +66,8 @@ function getAppName() {
|
|||
function getUserDataDir() {
|
||||
if (isCloud) return "/tmp";
|
||||
|
||||
if (process.env.DATA_DIR) return process.env.DATA_DIR;
|
||||
|
||||
try {
|
||||
const platform = process.platform;
|
||||
const homeDir = os.homedir();
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ function getAppName() {
|
|||
function getUserDataDir() {
|
||||
if (isCloud) return "/tmp"; // Fallback for Workers
|
||||
|
||||
if (process.env.DATA_DIR) return process.env.DATA_DIR;
|
||||
|
||||
try {
|
||||
const platform = process.platform;
|
||||
const homeDir = os.homedir();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue