mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-17 17:55:46 +01:00
Added LIBERATOR_HOME so that users don't have to define lots of environment _HOMEs as the liberator project grows.
This commit is contained in:
@@ -409,14 +409,25 @@ function IO() //{{{
|
|||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
path = path.replace("/", "\\", "g");
|
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))
|
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)
|
if (!home)
|
||||||
home = environmentService.get("HOME");
|
home = environmentService.get("HOME");
|
||||||
|
|
||||||
|
// On Windows, stretch even farther for other options
|
||||||
if (WINDOWS && !home)
|
if (WINDOWS && !home)
|
||||||
home = environmentService.get("USERPROFILE") ||
|
home = environmentService.get("USERPROFILE") ||
|
||||||
environmentService.get("HOMEDRIVE") + environmentService.get("HOMEPATH");
|
environmentService.get("HOMEDRIVE") + environmentService.get("HOMEPATH");
|
||||||
|
|||||||
Reference in New Issue
Block a user