1 Commits

Author SHA1 Message Date
cuddle-please
86e93faaf4 chore(release): 0.1.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-08-04 09:42:59 +00:00
3 changed files with 7 additions and 23 deletions

View File

@@ -6,10 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [0.1.2] - 2025-08-08 ## [0.1.2] - 2025-08-04
### Added
- default to current dir if no file could be found
### Other ### Other
- should be space instead - should be space instead

2
Cargo.lock generated
View File

@@ -431,7 +431,7 @@ dependencies = [
[[package]] [[package]]
name = "noil" name = "noil"
version = "0.1.1" version = "0.1.0"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"anyhow", "anyhow",

View File

@@ -40,13 +40,10 @@ pub struct EditCommand {
impl EditCommand { impl EditCommand {
pub async fn execute(&self) -> anyhow::Result<()> { pub async fn execute(&self) -> anyhow::Result<()> {
let mut small_id = Vec::new(); let mut small_id = Vec::with_capacity(8);
for id in small_id.iter_mut() {
for _ in 0..8 { *id = encode_rand::ALPHABET
small_id.push( [rand::random_range(0..(encode_rand::ALPHABET_LEN as u8)) as usize];
encode_rand::ALPHABET
[rand::random_range(0..(encode_rand::ALPHABET_LEN as u8)) as usize],
);
} }
let small_id = String::from_utf8_lossy(&small_id); let small_id = String::from_utf8_lossy(&small_id);
@@ -65,17 +62,7 @@ impl EditCommand {
.await .await
.context("create temp file for noil")?; .context("create temp file for noil")?;
let path = &self let path = &self.get_path().await.context("get path")?;
.get_path()
.await
.context("get path")
.inspect_err(|e| {
tracing::warn!(
"error: file path doesn't exist, defaulting to current working dir: {e}"
)
})
.unwrap_or_else(|_| PathBuf::from("."));
let output = get_outputs(path, true) let output = get_outputs(path, true)
.await .await
.context(format!("get output: {}", path.display()))?; .context(format!("get output: {}", path.display()))?;