mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Unix Build
This commit is contained in:
@@ -73,7 +73,7 @@ impl AuthActivity {
|
||||
///
|
||||
/// Check minimum window size window
|
||||
pub(super) fn check_minimum_window_size(&mut self, height: u16) {
|
||||
if height < 24 {
|
||||
if height < 25 {
|
||||
// Mount window error
|
||||
self.mount_size_err();
|
||||
} else {
|
||||
|
||||
@@ -656,7 +656,11 @@ impl FileTransferActivity {
|
||||
match self.host.mkdir_ex(local_dir_path.as_path(), true) {
|
||||
Ok(_) => {
|
||||
// Apply file mode to directory
|
||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||
#[cfg(any(
|
||||
target_family = "unix",
|
||||
target_os = "macos",
|
||||
target_os = "linux"
|
||||
))]
|
||||
if let Some(pex) = dir.unix_pex {
|
||||
if let Err(err) = self.host.chmod(local_dir_path.as_path(), pex) {
|
||||
self.log(
|
||||
@@ -813,7 +817,11 @@ impl FileTransferActivity {
|
||||
return Err(TransferErrorReason::Abrupted);
|
||||
}
|
||||
// Apply file mode to file
|
||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||
#[cfg(any(
|
||||
target_family = "unix",
|
||||
target_os = "macos",
|
||||
target_os = "linux"
|
||||
))]
|
||||
if let Some(pex) = remote.unix_pex {
|
||||
if let Err(err) = self.host.chmod(local, pex) {
|
||||
self.log(
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// Deps
|
||||
extern crate bytesize;
|
||||
extern crate hostname;
|
||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||
#[cfg(any(target_family = "unix", target_os = "macos", target_os = "linux"))]
|
||||
extern crate users;
|
||||
// locals
|
||||
use super::{browser::FileExplorerTab, Context, FileTransferActivity};
|
||||
@@ -59,7 +59,7 @@ use tuirealm::tui::{
|
||||
style::Color,
|
||||
widgets::{BorderType, Borders, Clear},
|
||||
};
|
||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||
#[cfg(any(target_family = "unix", target_os = "macos", target_os = "linux"))]
|
||||
use users::{get_group_by_gid, get_user_by_uid};
|
||||
|
||||
impl FileTransferActivity {
|
||||
@@ -813,7 +813,7 @@ impl FileTransferActivity {
|
||||
.build(),
|
||||
);
|
||||
// User
|
||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||
#[cfg(any(target_family = "unix", target_os = "macos", target_os = "linux"))]
|
||||
let username: String = match file.get_user() {
|
||||
Some(uid) => match get_user_by_uid(uid) {
|
||||
Some(user) => user.name().to_string_lossy().to_string(),
|
||||
@@ -824,7 +824,7 @@ impl FileTransferActivity {
|
||||
#[cfg(target_os = "windows")]
|
||||
let username: String = format!("{}", file.get_user().unwrap_or(0));
|
||||
// Group
|
||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||
#[cfg(any(target_family = "unix", target_os = "macos", target_os = "linux"))]
|
||||
let group: String = match file.get_group() {
|
||||
Some(gid) => match get_group_by_gid(gid) {
|
||||
Some(group) => group.name().to_string_lossy().to_string(),
|
||||
|
||||
Reference in New Issue
Block a user