Skip to content

Commit 94c38ce

Browse files
committed
feat: update version numbers in changelog and Cargo.toml, refactor home directory retrieval, and rename copy method to sync in operation module
1 parent 331bf95 commit 94c38ce

5 files changed

Lines changed: 28 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version 0.1.0-alpha (2025-07-27)
1+
# Version 0.1.0 (2025-07-27)
22

33
This is the first alpha release of the project. It includes the following features:
44

@@ -7,9 +7,17 @@ This is the first alpha release of the project. It includes the following featur
77
- Package management for installing packages.
88
- Basic dotfile management for managing dotfiles.
99

10-
# Version 0.1.1-alpha (2025-08-06)
10+
# Version 0.1.1 (2025-08-06)
1111

1212
This release includes the following improvements and bug fixes:
1313

1414
- Inserted detected os into the config.
1515
- Better package management.
16+
17+
# Version 0.1.3 (2025-08-11)
18+
19+
This release includes the following improvements and bug fixes:
20+
21+
- Added support for using network download configuration files protocol.
22+
- Renamed `op.copy` to `op.sync`.
23+
- Dotfile management improvements.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dv4lua"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2024"
55
description = "a lua-based command line tool that provides abstract user (device) interoperability"
66
authors = ["km0e <kmdr.error@gmail.com>"]
@@ -18,7 +18,6 @@ clap = { version = "4.5", features = ["derive"] }
1818
dv-wrap = { git = "https://github.com/km0e/dv-api", features = ["full"] }
1919
dv-api = { git = "https://github.com/km0e/dv-api", features = ["full"] }
2020
futures = "0.3"
21-
home = { version = "0.5" }
2221
mlua = { version = "0.11", features = ["async", "lua54", "vendored"] }
2322
os2 = { version = "0.1.0", features = ["serde"] }
2423
serde = { version = "1.0", features = ["derive"] }

src/arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clap::Parser;
22
use std::path::PathBuf;
33

44
fn default_config() -> PathBuf {
5-
home::home_dir()
5+
std::env::home_dir()
66
.expect("can't find home directory")
77
.join(".config/dv/")
88
}

src/multi/dot.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl Dot {
2727
impl UserData for Dot {
2828
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M) {
2929
methods.add_async_method_mut("confirm", |_, this, confirm: Option<String>| async move {
30-
*this.dot.write().await = DotUtil::new(confirm);
30+
this.dot.write().await.copy_action = confirm.unwrap_or_default();
3131
Ok(())
3232
});
3333

@@ -55,5 +55,17 @@ impl UserData for Dot {
5555
.await
5656
},
5757
);
58+
methods.add_async_method(
59+
"upload",
60+
|_, this, (apps, dst): (Vec<String>, String)| async move {
61+
let (ctx, dot) = this.lock().await;
62+
external_error(dot.upload(
63+
&ctx,
64+
apps.into_iter().map(DotConfig::new).collect(),
65+
&dst,
66+
))
67+
.await
68+
},
69+
);
5870
}
5971
}

src/multi/op.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Op {
1818
impl UserData for Op {
1919
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M) {
2020
methods.add_async_method(
21-
"copy",
21+
"sync",
2222
|_,
2323
this,
2424
(src, src_path, dst, dst_path, confirm): (
@@ -49,9 +49,9 @@ impl UserData for Op {
4949
.collect::<Result<Vec<_>, _>>()?;
5050
external_error(async {
5151
let ctx = this.ctx.read().await;
52-
let ctx = ops::CopyContext::new(&ctx, &src, &dst, confirm.as_deref())?;
52+
let ctx = ops::SyncContext::new(&ctx, &src, &dst, confirm.as_deref())?;
5353
let res = stream::iter(pairs)
54-
.map(|(src_path, dst_path)| ctx.copy(src_path, dst_path))
54+
.map(|(src_path, dst_path)| ctx.sync(src_path, dst_path))
5555
.buffered(4)
5656
.try_fold(false, |res, copy_res| async move { Ok(res | copy_res) })
5757
.await?;

0 commit comments

Comments
 (0)