Try to get RTP from IMAG_RTP
This commit is contained in:
parent
429194b5d0
commit
4250241f18
2 changed files with 16 additions and 8 deletions
|
@ -38,6 +38,8 @@ This section contains the changelog from the last release to the next release.
|
||||||
* `libimagentryannotation` got a rewrite, is not based on `libimagnotes`
|
* `libimagentryannotation` got a rewrite, is not based on `libimagnotes`
|
||||||
anymore. This is minor because `libimagentryanntation` is not yet used by
|
anymore. This is minor because `libimagentryanntation` is not yet used by
|
||||||
any other crate.
|
any other crate.
|
||||||
|
* imag now reads the `IMAG_RTP` environment variable before trying to access
|
||||||
|
`$HOME/.imag` for its runtimepath.
|
||||||
|
|
||||||
* Bugfixes
|
* Bugfixes
|
||||||
* `Store::entries()` does not yield StoreIds which point to directories
|
* `Store::entries()` does not yield StoreIds which point to directories
|
||||||
|
|
|
@ -454,14 +454,20 @@ fn get_rtp_match<'a>(matches: &ArgMatches<'a>) -> PathBuf {
|
||||||
|
|
||||||
matches.value_of(Runtime::arg_runtimepath_name())
|
matches.value_of(Runtime::arg_runtimepath_name())
|
||||||
.map_or_else(|| {
|
.map_or_else(|| {
|
||||||
env::var("HOME")
|
if let Ok(home) = env::var("IMAG_RTP") {
|
||||||
.map(PathBuf::from)
|
return PathBuf::from(home);
|
||||||
.map(|mut p| { p.push(".imag"); p })
|
}
|
||||||
.unwrap_or_else(|_| {
|
|
||||||
panic!("You seem to be $HOME-less. Please get a $HOME before using this \
|
match env::var("HOME") {
|
||||||
|
Ok(home) => {
|
||||||
|
let mut p = PathBuf::from(home);
|
||||||
|
p.push(".imag");
|
||||||
|
return p;
|
||||||
|
},
|
||||||
|
Err(_) => panic!("You seem to be $HOME-less. Please get a $HOME before using this \
|
||||||
software. We are sorry for you and hope you have some \
|
software. We are sorry for you and hope you have some \
|
||||||
accommodation anyways.");
|
accommodation anyways."),
|
||||||
})
|
}
|
||||||
}, PathBuf::from)
|
}, PathBuf::from)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue