diff options
author | Ted Pavlic <ted@tedpavlic.com> | 2008-12-12 07:42:19 -0500 |
---|---|---|
committer | Ted Pavlic <ted@tedpavlic.com> | 2008-12-12 07:42:19 -0500 |
commit | 47496af2e01c881dbaea84bebd1c48ea5dc1da3c (patch) | |
tree | 62062a2ac878cb0e525b9dedb4d23df89b1667b3 /common/content | |
parent | d182429dd3e95b250405ba73521309732c53f181 (diff) | |
download | pentadactyl-47496af2e01c881dbaea84bebd1c48ea5dc1da3c.tar.gz |
Added LIBERATOR_HOME so that users don't have to define lots of environment _HOMEs as the liberator project grows.
Diffstat (limited to 'common/content')
-rw-r--r-- | common/content/io.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/content/io.js b/common/content/io.js index a28d52b0..998846b4 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -409,14 +409,25 @@ function IO() //{{{ if (WINDOWS) path = path.replace("/", "\\", "g"); - // expand "~" to VIMPERATOR_HOME or HOME (USERPROFILE or HOMEDRIVE\HOMEPATH on Windows if HOME is not set) + /* expand "~" to + * LIBERATOR_HOME or + * (VIMPERATOR|MUTTATOR)_HOME or (depending on config.name) + * HOME (USERPROFILE or HOMEDRIVE\HOMEPATH on Windows if HOME is not set) + * in that order */ if (/^~/.test(path)) { - let home = environmentService.get(config.name.toUpperCase() + "_HOME"); + // First try LIBERATOR_HOME + let home = environmentService.get("LIBERATOR_HOME"); + // If no LIBERATOR_HOME, then try (VIMPERATOR|MUTTATOR)_HOME + if (!home) + home = environmentService.get(config.name.toUpperCase() + "_HOME"); + + // If no (VIMPERATOR|MUTTATOR)_HOME, try HOME if (!home) home = environmentService.get("HOME"); + // On Windows, stretch even farther for other options if (WINDOWS && !home) home = environmentService.get("USERPROFILE") || environmentService.get("HOMEDRIVE") + environmentService.get("HOMEPATH"); |