Merge branch '0.4.2' into main

This commit is contained in:
veeso
2021-04-13 18:44:02 +02:00
12 changed files with 25 additions and 32 deletions

View File

@@ -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

2
Cargo.lock generated
View File

@@ -1322,7 +1322,7 @@ dependencies = [
[[package]]
name = "termscp"
version = "0.4.1"
version = "0.4.2"
dependencies = [
"bitflags",
"bytesize",

View File

@@ -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"

View File

@@ -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:

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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<FsEntry> = 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<FsEntry> = ftp.list_dir(PathBuf::from("/").as_path()).ok().unwrap();
// There should be at least 1 file
assert!(files.len() > 0);

View File

@@ -898,7 +898,6 @@ mod tests {
// Get dir
let host: Localhost = Localhost::new(PathBuf::from(tmpdir.path())).ok().unwrap();
let files: Vec<FsEntry> = 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());
}

View File

@@ -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();

View File

@@ -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<Span> = 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<Spans> = Vec::with_capacity(columns.len() - 4);
// Get first row
let mut first_row: Vec<Span> = 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<Span> = 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));

View File

@@ -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);