-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
49 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
test.txt crypt=1 | ||
test.txt crypt=1 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ pub async fn decrypt_repo() -> anyhow::Result<()> { | |
) | ||
} | ||
} | ||
add_all()?; | ||
Ok(()) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#![feature(lazy_cell)] | ||
#![feature(vec_pop_if)] | ||
#![feature(let_chains)] | ||
#![warn(clippy::nursery, clippy::cargo)] | ||
#![allow(clippy::multiple_crate_versions)] | ||
|
||
mod cli; | ||
mod crypt; | ||
mod git_command; | ||
mod utils; | ||
|
||
use anyhow::{Ok, Result}; | ||
use git_command::{ | ||
add_crypt_attributes, config, decrypt_repo, encrypt_repo, remove_crypt_attributes, | ||
}; | ||
|
||
pub use crate::cli::{SubCommand, CLI}; | ||
|
||
pub async fn run(command: &SubCommand) -> Result<()> { | ||
match command { | ||
SubCommand::Encrypt => encrypt_repo().await?, | ||
SubCommand::Decrypt => decrypt_repo().await?, | ||
SubCommand::SetKey { key } => config::set_key(key)?, | ||
SubCommand::Add { path } => add_crypt_attributes(path)?, | ||
SubCommand::Remove { path } => remove_crypt_attributes(path)?, | ||
SubCommand::Set { field, value } => config::set(field.name(), value)?, | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,7 @@ | ||
#![feature(lazy_cell)] | ||
#![feature(vec_pop_if)] | ||
#![feature(let_chains)] | ||
#![warn(clippy::nursery, clippy::cargo)] | ||
|
||
mod cli; | ||
mod crypt; | ||
mod git_command; | ||
mod utils; | ||
|
||
use anyhow::{Ok, Result}; | ||
use cli::{SubCommand, CLI}; | ||
use git_command::{ | ||
add_crypt_attributes, config, decrypt_repo, encrypt_repo, remove_crypt_attributes, | ||
}; | ||
use git_simple_encrypt::{run, CLI}; | ||
|
||
#[compio::main] | ||
async fn main() -> Result<()> { | ||
async fn main() -> anyhow::Result<()> { | ||
env_logger::init(); | ||
match &CLI.command { | ||
SubCommand::Encrypt => encrypt_repo().await?, | ||
SubCommand::Decrypt => decrypt_repo().await?, | ||
SubCommand::SetKey { key } => config::set_key(key)?, | ||
SubCommand::Add { path } => add_crypt_attributes(path)?, | ||
SubCommand::Remove { path } => remove_crypt_attributes(path)?, | ||
SubCommand::Set { field, value } => config::set(field.name(), value)?, | ||
} | ||
Ok(()) | ||
run(&CLI.command).await | ||
} |