diff --git a/CHANGELOG.md b/CHANGELOG.md index dd64bd0..048a1f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog - [Changelog](#changelog) + - [0.4.2](#042) - [0.4.1](#041) - [0.4.0](#040) - [0.3.3](#033) @@ -15,6 +16,15 @@ --- +## 0.4.2 + +Released on 13/04/2021 + +- Enhancements: + - Use highlight symbol for logbox of `tui-rs` instead of adding a `Span` +- Bugfix: + - removed `eprintln!` in ftp transfer causing UI to break in Windows + ## 0.4.1 Released on 07/04/2021 diff --git a/Cargo.lock b/Cargo.lock index 826a2de..25a9548 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1322,7 +1322,7 @@ dependencies = [ [[package]] name = "termscp" -version = "0.4.1" +version = "0.4.2" dependencies = [ "bitflags", "bytesize", diff --git a/Cargo.toml b/Cargo.toml index b0bebf0..86be254 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "termscp" readme = "README.md" repository = "https://github.com/veeso/termscp" -version = "0.4.1" +version = "0.4.2" [package.metadata.rpm] package = "termscp" diff --git a/README.md b/README.md index 1f934f8..d60b6a9 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # TermSCP -[![License: MIT](https://img.shields.io/badge/License-MIT-teal.svg)](https://opensource.org/licenses/MIT) [![Stars](https://img.shields.io/github/stars/veeso/termscp.svg)](https://github.com/veeso/termscp) [![Downloads](https://img.shields.io/crates/d/termscp.svg)](https://crates.io/crates/termscp) [![Crates.io](https://img.shields.io/badge/crates.io-v0.4.1-orange.svg)](https://crates.io/crates/termscp) [![Docs](https://docs.rs/termscp/badge.svg)](https://docs.rs/termscp) +[![License: MIT](https://img.shields.io/badge/License-MIT-teal.svg)](https://opensource.org/licenses/MIT) [![Stars](https://img.shields.io/github/stars/veeso/termscp.svg)](https://github.com/veeso/termscp) [![Downloads](https://img.shields.io/crates/d/termscp.svg)](https://crates.io/crates/termscp) [![Crates.io](https://img.shields.io/badge/crates.io-v0.4.2-orange.svg)](https://crates.io/crates/termscp) [![Docs](https://docs.rs/termscp/badge.svg)](https://docs.rs/termscp) [![Build](https://github.com/veeso/termscp/workflows/Linux/badge.svg)](https://github.com/veeso/termscp/actions) [![Build](https://github.com/veeso/termscp/workflows/MacOS/badge.svg)](https://github.com/veeso/termscp/actions) [![Build](https://github.com/veeso/termscp/workflows/Windows/badge.svg)](https://github.com/veeso/termscp/actions) ~ Basically, WinSCP on a terminal ~ Developed by Christian Visintin -Current version: 0.4.1 (07/04/2021) +Current version: 0.4.2 (13/04/2021) --- @@ -100,8 +100,8 @@ Requirements: ### Deb package 📦 -Get `deb` package from [HERE](https://github.com/veeso/termscp/releases/latest/download/termscp_0.4.1_amd64.deb) -or run `wget https://github.com/veeso/termscp/releases/latest/download/termscp_0.4.1_amd64.deb` +Get `deb` package from [HERE](https://github.com/veeso/termscp/releases/latest/download/termscp_0.4.2_amd64.deb) +or run `wget https://github.com/veeso/termscp/releases/latest/download/termscp_0.4.2_amd64.deb` then install through dpkg: @@ -113,8 +113,8 @@ gdebi termscp_*.deb ### RPM package 📦 -Get `rpm` package from [HERE](https://github.com/veeso/termscp/releases/latest/download/termscp-0.4.1-1.x86_64.rpm) -or run `wget https://github.com/veeso/termscp/releases/latest/download/termscp-0.4.1-1.x86_64.rpm` +Get `rpm` package from [HERE](https://github.com/veeso/termscp/releases/latest/download/termscp-0.4.2-1.x86_64.rpm) +or run `wget https://github.com/veeso/termscp/releases/latest/download/termscp-0.4.2-1.x86_64.rpm` then install through rpm: @@ -140,7 +140,7 @@ Start PowerShell as administrator and run choco install termscp ``` -Alternatively you can download the ZIP file from [HERE](https://github.com/veeso/termscp/releases/latest/download/termscp.0.4.1.nupkg) +Alternatively you can download the ZIP file from [HERE](https://github.com/veeso/termscp/releases/latest/download/termscp.0.4.2.nupkg) and then with PowerShell started with administrator previleges, run: diff --git a/dist/pkgs/arch/.SRCINFO b/dist/pkgs/arch/.SRCINFO index 910ccf1..610bd65 100644 --- a/dist/pkgs/arch/.SRCINFO +++ b/dist/pkgs/arch/.SRCINFO @@ -1,13 +1,13 @@ pkgbase = termscp pkgdesc = TermSCP is a SCP/SFTP/FTPS client for command line with an integrated UI to explore the remote file system. Basically WinSCP on a terminal. - pkgver = 0.4.1 + pkgver = 0.4.2 pkgrel = 1 url = https://github.com/veeso/termscp arch = x86_64 license = MIT provides = termscp options = strip - source = https://github.com/veeso/termscp/releases/download/v0.4.1/termscp-0.4.1-x86_64.tar.gz + source = https://github.com/veeso/termscp/releases/download/v0.4.2/termscp-0.4.2-x86_64.tar.gz sha256sums = 0862fafbeb957a657db14dc5954bb73350c1675ba30a01580b96cb044f1443fe pkgname = termscp diff --git a/dist/pkgs/arch/PKGBUILD b/dist/pkgs/arch/PKGBUILD index b5c6153..cc31ff7 100644 --- a/dist/pkgs/arch/PKGBUILD +++ b/dist/pkgs/arch/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Christian Visintin pkgname=termscp -pkgver=0.4.1 +pkgver=0.4.2 pkgrel=1 pkgdesc="TermSCP is a SCP/SFTP/FTPS client for command line with an integrated UI to explore the remote file system. Basically WinSCP on a terminal." url="https://github.com/veeso/termscp" diff --git a/src/config/serializer.rs b/src/config/serializer.rs index df2e804..a4ba940 100644 --- a/src/config/serializer.rs +++ b/src/config/serializer.rs @@ -101,7 +101,6 @@ mod tests { // Parse let deserializer: ConfigSerializer = ConfigSerializer {}; let cfg = deserializer.deserialize(Box::new(toml_file)); - println!("{:?}", cfg); assert!(cfg.is_ok()); let cfg: UserConfig = cfg.ok().unwrap(); // Verify configuration @@ -141,7 +140,6 @@ mod tests { // Parse let deserializer: ConfigSerializer = ConfigSerializer {}; let cfg = deserializer.deserialize(Box::new(toml_file)); - println!("{:?}", cfg); assert!(cfg.is_ok()); let cfg: UserConfig = cfg.ok().unwrap(); // Verify configuration diff --git a/src/filetransfer/ftp_transfer.rs b/src/filetransfer/ftp_transfer.rs index ddf9b7b..1a8bab3 100644 --- a/src/filetransfer/ftp_transfer.rs +++ b/src/filetransfer/ftp_transfer.rs @@ -228,7 +228,6 @@ impl FtpFileTransfer { }), })), }; - eprintln!("{:?};{:?}", is_dir, symlink); let mut abs_path: PathBuf = PathBuf::from(path); abs_path.push(file_name.as_str()); let abs_path: PathBuf = Self::resolve(abs_path.as_path()); @@ -1111,7 +1110,6 @@ mod tests { // Pwd assert_eq!(ftp.pwd().ok().unwrap(), PathBuf::from("/")); // List dir - println!("{:?}", ftp.list_dir(PathBuf::from("/").as_path())); let files: Vec = ftp.list_dir(PathBuf::from("/").as_path()).ok().unwrap(); // There should be at least 1 file assert!(files.len() > 0); @@ -1130,7 +1128,6 @@ mod tests { // Pwd assert_eq!(ftp.pwd().ok().unwrap(), PathBuf::from("/")); // List dir - println!("{:?}", ftp.list_dir(PathBuf::from("/").as_path())); let files: Vec = ftp.list_dir(PathBuf::from("/").as_path()).ok().unwrap(); // There should be at least 1 file assert!(files.len() > 0); diff --git a/src/host/mod.rs b/src/host/mod.rs index cba7f1a..32992f6 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -898,7 +898,6 @@ mod tests { // Get dir let host: Localhost = Localhost::new(PathBuf::from(tmpdir.path())).ok().unwrap(); let files: Vec = host.list_dir(); - println!("Entries {:?}", files); // Verify files let file_0: &FsEntry = files.get(0).unwrap(); match file_0 { @@ -1122,7 +1121,6 @@ mod tests { // Verify dir_dest contains foo.txt let mut test_file_path: PathBuf = dir_dest.clone(); test_file_path.push("foo.txt"); - println!("{:?}", host.scan_dir(tmpdir.path()).ok().unwrap()); assert!(host.stat(test_file_path.as_path()).is_ok()); } diff --git a/src/system/config_client.rs b/src/system/config_client.rs index 2c22790..57f47fa 100644 --- a/src/system/config_client.rs +++ b/src/system/config_client.rs @@ -525,7 +525,6 @@ mod tests { // Iterate keys for key in client.iter_ssh_keys() { let host: SshHost = client.get_ssh_key(key).ok().unwrap().unwrap(); - println!("{:?}", host); assert_eq!(host.0, String::from("192.168.1.31")); assert_eq!(host.1, String::from("pi")); let mut expected_key_path: PathBuf = key_path.clone(); diff --git a/src/ui/layout/components/logbox.rs b/src/ui/layout/components/logbox.rs index bb3aa75..e785a41 100644 --- a/src/ui/layout/components/logbox.rs +++ b/src/ui/layout/components/logbox.rs @@ -144,8 +144,7 @@ impl Component for LogBox { None => Vec::new(), Some(table) => table .iter() - .enumerate() - .map(|(idx, row)| { + .map(|row| { let mut columns: VecDeque = row .iter() .map(|col| { @@ -161,15 +160,7 @@ impl Component for LogBox { // Let's convert column spans into Spans rows NOTE: -4 because first line is always made by 5 columns; but there's always 1 let mut rows: Vec = Vec::with_capacity(columns.len() - 4); // Get first row - let mut first_row: Vec = vec![Span::styled( - match self.states.list_index == idx { - true => "> ", - false => " ", - }, - Style::default() - .fg(self.props.foreground) - .bg(self.props.background), - )]; + let mut first_row: Vec = Vec::with_capacity(5); for _ in 0..5 { if let Some(col) = columns.pop_front() { first_row.push(col); @@ -204,6 +195,7 @@ impl Component for LogBox { .title(title), ) .start_corner(Corner::BottomLeft) + .highlight_symbol(">> ") .highlight_style(Style::default().add_modifier(self.props.get_modifiers())); let mut state: ListState = ListState::default(); state.select(Some(self.states.list_index)); diff --git a/src/ui/layout/utils.rs b/src/ui/layout/utils.rs index 543abbc..6968d00 100644 --- a/src/ui/layout/utils.rs +++ b/src/ui/layout/utils.rs @@ -64,7 +64,6 @@ mod tests { fn test_ui_layout_utils_draw_area_in() { let area: Rect = Rect::new(0, 0, 1024, 512); let child: Rect = draw_area_in(area, 75, 30); - println!("{:?}", child); assert_eq!(child.x, 43); assert_eq!(child.y, 63); assert_eq!(child.width, 271);