Skip to content

Commit

Permalink
version 8.0.1, fix path handling bug in #53
Browse files Browse the repository at this point in the history
  • Loading branch information
spieglt committed Dec 31, 2023
1 parent f0ea498 commit b8ae481
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Flying Carpet/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flying-carpet"
version = "8.0.0"
version = "8.0.1"
description = "Encrypted file transfer over ad hoc WiFi between Android, iOS, Linux, macOS, and Windows"
authors = ["Theron Spiegl"]
license = "GPL-3.0-only"
Expand Down
2 changes: 1 addition & 1 deletion Flying Carpet/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "FlyingCarpet",
"version": "8.0.0"
"version": "8.0.1"
},
"tauri": {
"allowlist": {
Expand Down
4 changes: 2 additions & 2 deletions Flying Carpet/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ window.modeChange = modeChange;
window.peerChange = peerChange;

const aboutMessage = `https://flyingcarpet.spiegl.dev
Version: 8.0
Version: 8.0.1
theron@spiegl.dev
Copyright (c) 2023, Theron Spiegl
Copyright (c) 2024, Theron Spiegl
All rights reserved.
Flying Carpet performs file transfers between two laptops or phones (Android, iOS, Linux, Mac, Windows) via ad hoc WiFi. No access point or network gear is required. Just select a file, whether each device is sending or receiving, and the operating system of the other device. For mobile versions, search for "Flying Carpet File Transfer" in the Apple App Store or Google Play Store.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, Theron Spiegl
Copyright (c) 2024, Theron Spiegl
All rights reserved.

GNU GENERAL PUBLIC LICENSE
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flying-carpet-core"
version = "8.0.0"
version = "8.0.1"
edition = "2021"
license = "GPL-3.0-only"

Expand Down
13 changes: 8 additions & 5 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sha2::{Digest, Sha256};
use std::{
error::Error,
net::SocketAddr,
path::PathBuf,
path::{PathBuf, Path},
str::FromStr,
sync::{Arc, Mutex},
};
Expand Down Expand Up @@ -178,16 +178,19 @@ pub async fn start_transfer<T: UI>(
}
}
// find folder common to all files
let mut common_folder = files[0].parent().expect("file has no parent");
let mut common_folder = files[0].parent().or(Some(Path::new(""))).unwrap();
if files.len() > 1 {
for file in &files[1..] {
let current = file.parent().expect("file has no parent");
if current.components().collect::<Vec<_>>().len() < common_folder.components().collect::<Vec<_>>().len() {
let current = file.parent().or(Some(Path::new(""))).unwrap();
let current_len = current.components().collect::<Vec<_>>().len();
let common_len = common_folder.components().collect::<Vec<_>>().len();
if current_len < common_len {
common_folder = current;
} else if current_len == common_len {
common_folder = current.parent().or(Some(Path::new(""))).unwrap();
}
}
}
ui.output(&format!("common folder: {}", common_folder.display()));
// send files
for (i, file) in files.iter().enumerate() {
let file_name = file
Expand Down

0 comments on commit b8ae481

Please sign in to comment.