From d18cfe4ac15bd5211811f129eb730a7b0f4ad3b1 Mon Sep 17 00:00:00 2001 From: Jason Rogena Date: Sun, 10 Jul 2022 16:53:05 +0100 Subject: [PATCH] Rename package to fs-librarian Rename the package to fs-librarian before we publish on crates.io. We are renaming because there already exists a package called librarian in crates.io. Signed-off-by: Jason Rogena --- Cargo.lock | 32 ++++++++++++++++---------------- Cargo.toml | 10 +++++++++- README.md | 10 +++++----- src/main.rs | 4 ++-- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ba64b0..bf408cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,6 +231,22 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fs-librarian" +version = "0.1.0" +dependencies = [ + "clap", + "exitcode", + "notify", + "regex", + "serde", + "serde_derive", + "tera", + "toml", + "tree_magic", + "ttl_cache", +] + [[package]] name = "fsevent" version = "0.4.0" @@ -428,22 +444,6 @@ version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" -[[package]] -name = "librarian" -version = "0.1.0" -dependencies = [ - "clap", - "exitcode", - "notify", - "regex", - "serde", - "serde_derive", - "tera", - "toml", - "tree_magic", - "ttl_cache", -] - [[package]] name = "linked-hash-map" version = "0.5.4" diff --git a/Cargo.toml b/Cargo.toml index 8e53ad1..e4b3a0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,17 @@ [package] -name = "librarian" +name = "fs-librarian" version = "0.1.0" authors = ["Jason Rogena "] edition = "2021" rust-version = "1.61" +readme = "README.md" +license-file = "LICENSE" +documentation = "https://github.com/jasonrogena/librarian/blob/main/README.md" +description = "Librarian runs pre-configured commands against a group of files that match a set of filters" +homepage = "https://github.com/jasonrogena/librarian" +repository = "https://github.com/jasonrogena/librarian" +keywords = ["directory", "file", "file-manager", "organiser", "organizer"] +categories = ["command-line-utilities", "filesystem"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index 89dfd41..cd1767c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Librarian +## Filesystem Librarian [![Build Status](https://github.com/jasonrogena/librarian/workflows/CI/badge.svg)](https://github.com/jasonrogena/librarian/actions?query=workflow%3ACI)[![codecov](https://codecov.io/gh/jasonrogena/librarian/branch/main/graph/badge.svg?token=O3PNGORLW8)](https://codecov.io/gh/jasonrogena/librarian) @@ -7,13 +7,13 @@ Librarian runs pre-configured commands against a group of files that match a set To run Librarian once, where it exits after searching through a list of configured libraries, run: ```sh -librarian single-shot path/to/config.toml +fs-librarian single-shot path/to/config.toml ``` To make Librarian continually watch for when files in configured libraries are created or updated, run: ```sh -librarian watch path/to/config.toml +fs-librarian watch path/to/config.toml ``` ### Building @@ -24,7 +24,7 @@ You can use the pre-built binaries on the [release page](./releases) or build Li make clean build ``` -The binary `target/release/librarian` will be generated. +The binary `target/release/fs-librarian` will be generated. ### Configuration @@ -40,7 +40,7 @@ In the Librarian configuration file, define one or more "libraries" of files. A For each of the defined libraries, provide a [Tera template](https://tera.netlify.app/docs/#templates) (whose syntax is based on Jinja2) of the command that should run when a file is found. The following variables are available to the template: - `{{ file_path }}`: The path to the file that was found -- `{{ mime_type }}`: The MIME type for the file that was found. Run the `librarian test mime ` command to display the MIME types of files you are unsure about. +- `{{ mime_type }}`: The MIME type for the file that was found. Run the `fs-librarian test mime ` command to display the MIME types of files you are unsure about. The following configuration snippet defines a music library which watches for files inside the Downloads and /tmp directories that have MIME types matching the `audio/.+` regex (e.g. `audio/flac` and `audio/ogg`). When an audio file is found, it is moved to the Music directory: diff --git a/src/main.rs b/src/main.rs index 706d25e..7ebe0a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,9 +15,9 @@ use std::time::Duration; static GLOBAL_THREAD_COUNT: AtomicUsize = AtomicUsize::new(0); static GLOBAL_FAILED_TREADS: AtomicUsize = AtomicUsize::new(0); -/// Goes through files inside directories and does with them as you wish +/// Runs pre-configured commands against a group of files that match a set of filters #[derive(Debug, Parser)] -#[clap(name = "librarian")] +#[clap(name = "fs-librarian")] #[clap(about = "Goes through file types inside directories and does with them as you wish", long_about = None)] struct Cli { #[clap(subcommand)]