From e5623a1cf5010728fa360ceb26386afa72086bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=20Duc=20L=C3=A9andre?= Date: Fri, 29 Aug 2025 12:20:11 +0200 Subject: [PATCH 1/3] chore: crate name is now replay_pty + changed authors --- Cargo.lock | 4 ++-- Cargo.toml | 10 ++++++++-- src/main.rs | 2 +- tests/integration_test.rs | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2f6318..558762f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -848,8 +848,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "replay" -version = "0.1.0" +name = "replay_pty" +version = "0.0.1" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index aff93a6..5489adb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [package] -name = "replay" -version = "0.1.0" +name = "replay_pty" +version = "0.0.1" +authors = ["leduclean", "baptleduc"] edition = "2024" description = "A CLI tool to record and replay shell commands" readme = "README.md" @@ -10,6 +11,11 @@ repository = "https://github.com/baptleduc/replay" [lib] path = "src/lib.rs" +[[bin]] +name = "replay" +path = "src/main.rs" + + [dependencies] anyhow = "1.0.98" assert_cmd = "2.0.17" diff --git a/src/main.rs b/src/main.rs index d56363a..3b75446 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ // Argument parsing, command dispatching and core logic. use crossterm::terminal; -use replay::run; +use replay_pty::run; use std::{env, process}; fn main() { diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 2ccff10..66b4507 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -1,6 +1,6 @@ use assert_cmd::Command; use predicates::prelude::*; -use replay::session::Session; +use replay_pty::session::Session; use serial_test::serial; use uuid::Uuid; From 0ed3eea7a445e15fc39ce6deba86c3697dfce7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=20Duc=20L=C3=A9andre?= Date: Wed, 10 Sep 2025 18:01:17 +0200 Subject: [PATCH 2/3] fix(edition): rust edition from 2024 to 2021 which is latest major --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5489adb..15f76ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "replay_pty" version = "0.0.1" authors = ["leduclean", "baptleduc"] -edition = "2024" +edition = "2021" description = "A CLI tool to record and replay shell commands" readme = "README.md" license = "MIT" From f4067afa9c4d4b68993e6ce97d840a18b23fdd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=20Duc=20L=C3=A9andre?= Date: Wed, 10 Sep 2025 18:11:22 +0200 Subject: [PATCH 3/3] fix(format): formatted all the files, hook bugged --- src/args.rs | 2 +- src/commands/record.rs | 2 +- src/commands/run.rs | 4 ++-- src/session.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/args.rs b/src/args.rs index 3ee963c..94ad754 100644 --- a/src/args.rs +++ b/src/args.rs @@ -4,7 +4,7 @@ //! It will ensure we get the correct args and then return //! a correct Structure to run the corresponding commands use crate::{ - commands::{RunnableCommand, clear, drop, list, record, run}, + commands::{clear, drop, list, record, run, RunnableCommand}, errors::ReplayResult, }; use clap::{Parser, Subcommand}; diff --git a/src/commands/record.rs b/src/commands/record.rs index a8a6ad3..e2cead4 100644 --- a/src/commands/record.rs +++ b/src/commands/record.rs @@ -2,7 +2,7 @@ use std::io::{stdin, stdout}; use super::RunnableCommand; use crate::errors::ReplayResult; -use crate::pty::{RecordConfig, run_internal}; +use crate::pty::{run_internal, RecordConfig}; use clap::Args; #[derive(Args, PartialEq, Eq, Debug)] diff --git a/src/commands/run.rs b/src/commands/run.rs index 4cea732..1c9f27f 100644 --- a/src/commands/run.rs +++ b/src/commands/run.rs @@ -3,9 +3,9 @@ use super::RunnableCommand; use crate::args; use crate::errors::ReplayResult; -use crate::pty::{RawModeReader, RecordConfig, run_internal}; +use crate::pty::{run_internal, RawModeReader, RecordConfig}; use crate::session::Session; -use clap::{Args, value_parser}; +use clap::{value_parser, Args}; use std::io::stdout; /// CLI command to run a recorded session. diff --git a/src/session.rs b/src/session.rs index ea8a5b1..3f736c3 100644 --- a/src/session.rs +++ b/src/session.rs @@ -2,7 +2,7 @@ use crate::errors::{ReplayError, ReplayResult}; use crate::paths; use chrono::Utc; use rev_lines::RevLines; -use serde::{Deserialize, Deserializer, Serialize, de::DeserializeOwned}; +use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize}; use sha2::{Digest, Sha256}; use std::fs::File; use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write};