mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 01:26:04 -08:00
Fixed system test which deleted the termscp configuration
This commit is contained in:
@@ -31,6 +31,7 @@ Released on 27/03/2021
|
||||
- Fixed a bug causing termscp to crash if removing a bookmark
|
||||
- Fixed file format cursor position in the GUI
|
||||
- Fixed a bug causing termscp to show two equal bookmarks when overwriting one.
|
||||
- Fixed system tests which deleted the termscp configuration when launched
|
||||
- **LICENSE**: changed license to MIT
|
||||
- Dependencies:
|
||||
- Removed `unicode-width`
|
||||
|
||||
@@ -37,9 +37,14 @@ use std::path::{Path, PathBuf};
|
||||
/// Returns None, if it's not possible to get it
|
||||
pub fn init_config_dir() -> Result<Option<PathBuf>, String> {
|
||||
// Get file
|
||||
#[cfg(not(test))]
|
||||
lazy_static! {
|
||||
static ref CONF_DIR: Option<PathBuf> = dirs::config_dir();
|
||||
}
|
||||
#[cfg(test)]
|
||||
lazy_static! {
|
||||
static ref CONF_DIR: Option<PathBuf> = Some(std::env::temp_dir());
|
||||
}
|
||||
if CONF_DIR.is_some() {
|
||||
// Get path of bookmarks
|
||||
let mut p: PathBuf = CONF_DIR.as_ref().unwrap().clone();
|
||||
@@ -100,7 +105,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_system_environment_get_config_dir_err() {
|
||||
let mut conf_dir: PathBuf = dirs::config_dir().unwrap();
|
||||
let mut conf_dir: PathBuf = std::env::temp_dir();
|
||||
conf_dir.push("termscp");
|
||||
// Create file
|
||||
let mut f: File = OpenOptions::new()
|
||||
|
||||
Reference in New Issue
Block a user