Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,441 changes: 11 additions & 1,430 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ repository = "https://github.com/casey/filepack"
include = ["CHANGELOG.md", "CONTRIBUTING", "LICENSE", "README.md", "src", "tests"]

[dependencies]
axum = "0.8.4"
blake3 = { version = "1.5.4", features = ["mmap", "rayon", "serde"] }
boilerplate = { version = "1.0.1", features = ["axum"] }
camino = { version = "1.1.9", features = ["serde1"] }
clap = { version = "4.5.16", features = ["derive"] }
clap_mangen = "0.2.23"
dirs = "5.0.1"
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
hex = "0.4.3"
html-escaper = "0.2.0"
indicatif = "0.17.8"
lexiclean = "0.0.1"
owo-colors = "4"
Expand All @@ -32,18 +29,13 @@ serde_json = "1.0.127"
serde_with = "3.11.0"
serde_yaml = "0.9.34"
snafu = "0.8.4"
tokio = { version = "1.46.1", features = ["rt-multi-thread"] }
walkdir = "2.5.0"

[dev-dependencies]
assert_cmd = { version = "2.0.16", features = ["color-auto"] }
assert_fs = { version = "1.1.2", features = ["color-auto"] }
axum-test = "17.3.0"
executable-path = "1.0.0"
predicates = "3.1.2"
pretty_assertions = "1.4.1"
regex = "1.10.6"
reqwest = { version = "0.12.22", features = ["blocking"] }

[lints.clippy]
all = { level = "deny", priority = -1 }
Expand Down
67 changes: 0 additions & 67 deletions src/bytes.rs

This file was deleted.

17 changes: 0 additions & 17 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,6 @@ pub(crate) enum Error {
backtrace: Option<Backtrace>,
path: DisplayPath,
},
#[snafu(display("failed to bind server to `{address}:{port}`"))]
ServerBind {
address: String,
backtrace: Option<Backtrace>,
port: u16,
source: io::Error,
},
#[snafu(display("failed to run server"))]
ServerRun {
backtrace: Option<Backtrace>,
source: io::Error,
},
#[snafu(display("failed to initialize server runtime"))]
ServerRuntime {
backtrace: Option<Backtrace>,
source: io::Error,
},
#[snafu(display("manifest has already been signed by public key `{public_key}`"))]
SignatureAlreadyExists {
backtrace: Option<Backtrace>,
Expand Down
50 changes: 5 additions & 45 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
use {
self::{
arguments::Arguments, bytes::Bytes, display_path::DisplayPath, display_secret::DisplaySecret,
entry::Entry, error::Error, hash::Hash, lint::Lint, lint_group::LintGroup, list::List,
manifest::Manifest, metadata::Metadata, options::Options, owo_colorize_ext::OwoColorizeExt,
package::Package, private_key::PrivateKey, public_key::PublicKey, relative_path::RelativePath,
arguments::Arguments, display_path::DisplayPath, display_secret::DisplaySecret, entry::Entry,
error::Error, hash::Hash, lint::Lint, lint_group::LintGroup, list::List, manifest::Manifest,
metadata::Metadata, options::Options, owo_colorize_ext::OwoColorizeExt,
private_key::PrivateKey, public_key::PublicKey, relative_path::RelativePath,
signature::Signature, signature_error::SignatureError, style::Style, subcommand::Subcommand,
template::Template, utf8_path_ext::Utf8PathExt,
},
blake3::Hasher,
boilerplate::Boilerplate,
camino::{Utf8Component, Utf8Path, Utf8PathBuf},
clap::{Parser, ValueEnum},
html_escaper::{Escape, Trusted},
indicatif::{ProgressBar, ProgressStyle},
lexiclean::Lexiclean,
owo_colors::Styled,
Expand All @@ -30,51 +28,14 @@ use {
path::{Path, PathBuf},
process,
str::{self, FromStr},
sync::Arc,
},
tokio::runtime::Runtime,
walkdir::WalkDir,
};

#[cfg(test)]
use {
assert_fs::{
fixture::{FileWriteStr, PathChild, PathCreateDir},
TempDir,
},
std::ffi::OsString,
};

#[cfg(test)]
macro_rules! command {
( $($argument:expr),* $(,)?) => {
{
#![allow(clippy::vec_init_then_push)]

let mut arguments = Vec::<OsString>::new();

arguments.push("filepack".into());

arguments.push("--quiet".into());

$(
arguments.push($argument.into());
)*

let arguments = match Arguments::try_parse_from(arguments) {
Ok(arguments) => arguments,
Err(error) => {
panic!("{error}");
}
};

arguments.run().unwrap();
}
};
}
use assert_fs::TempDir;

mod arguments;
mod bytes;
mod display_path;
mod display_secret;
mod entry;
Expand All @@ -88,7 +49,6 @@ mod manifest;
mod metadata;
mod options;
mod owo_colorize_ext;
mod package;
mod private_key;
mod progress_bar;
mod public_key;
Expand Down
4 changes: 0 additions & 4 deletions src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ impl Manifest {
pub(crate) fn store(&self, path: &Utf8Path) -> Result<()> {
filesystem::write(path, format!("{}\n", serde_json::to_string(self).unwrap()))
}

pub(crate) fn total_size(&self) -> u64 {
self.files.values().map(|entry| entry.size).sum()
}
}

#[cfg(test)]
Expand Down
36 changes: 0 additions & 36 deletions src/package.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ mod hash;
mod key;
mod keygen;
mod man;
mod server;
mod sign;
mod verify;

Expand All @@ -39,8 +38,6 @@ pub(crate) enum Subcommand {
Keygen,
#[command(about = "Print man page")]
Man,
#[command(about = "Run server")]
Server(server::Server),
#[command(about = "Sign manifest")]
Sign(sign::Sign),
#[command(about = "Verify manifest")]
Expand All @@ -56,7 +53,6 @@ impl Subcommand {
Self::Key => key::run(options),
Self::Keygen => keygen::run(options),
Self::Man => man::run(),
Self::Server(server) => server.run(),
Self::Sign(sign) => sign.run(options),
Self::Verify(verify) => verify.run(options),
}
Expand Down
Loading
Loading