| Crates.io | archie |
| lib.rs | archie |
| version | 1.0.2 |
| created_at | 2023-04-24 22:49:40.752899+00 |
| updated_at | 2023-04-24 23:14:31.72556+00 |
| description | Create folder structures |
| homepage | https://github.com/Essay97/archie |
| repository | https://github.com/Essay97/archie |
| max_upload_size | |
| id | 847991 |
| size | 37,388 |
Archie is a command line utility that helps building folder structures based on a template. You can provide templates based on a configuration file passed in one of the following ways, sorted by priority:
--config <path/to/file>option.archierc.yaml file in current directoryarchie.yaml in global configuration directory
$XDG_CONFIG_HOME/archie or $HOME/.config/archie on Linux%USERPROFILE%\AppData\Roaming\archie on Windows$HOME/Library/Application Support/archie on macOSYou can install Archie via Homebrew, you just have to add my tap:
brew tap essay97/harrysthings
brew update
brew install archie
If you are a Rust user and are familiar with the tools, you can install Archie directly from crates.io using cargo:
cargo install archie
Whatever method you choose to pass the configuration file, the format is always the same: a YAML file with a single root object templates.
You define a new template by adding a key to the templates object.
A template can contain 2 types of nodes:
//Compose and nest these 2 types of nodes to shape your templates.
Let's say I want to define a template called "example":
templates:
example: # creates the "example" template
foo/: # creates the "foo" folder
hello.txt: # creates the "hello.txt"
my_folder/: # creates the empty folder "my_folder"
bar/: # creates the "bar" folder at the same level of "foo"
file: # creates the "file" file at the same level of "foo" and "bar"
Notice that Archie takes into account only the keys of the configuration file, so even files have to be objects, just without body (i.e. with a null body).
As a rule of thumb, every YAML element that you want to turn into a file or a folder, has to be followed by a colon.
Your starting point should be archie help to have an overview of the functionalities of this tool.
It does these simple things:
archie build <path> <template> creates the folder structure defined by template in the given patharchie list shows the available templates based on the provided configuration filearchie info <template> shows the structure created by the given template. Think of it like some sort of "dry run"Based on the configuration file defined on the previous section:
> archie list
example
> archie info example
example
├── bar
├── foo
│ ├── hello.txt
│ └── my_folder
└── file
> archie build . example
## Creates example template in current directory