Skip to content

Commit

Permalink
Rename package to fs-librarian
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jasonrogena committed Jul 10, 2022
1 parent f857c22 commit d18cfe4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

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

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
[package]
name = "librarian"
name = "fs-librarian"
version = "0.1.0"
authors = ["Jason Rogena <[email protected]>"]
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

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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 <path to a file>` 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 <path to a file>` 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:

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit d18cfe4

Please sign in to comment.