skip unparsable issues #26
4 changed files with 136 additions and 74 deletions
|
|
@ -48,19 +48,23 @@ impl Comment {
|
|||
}
|
||||
}
|
||||
}
|
||||
if description == None {
|
||||
let Some(description) = description else {
|
||||
return Err(CommentError::CommentParseError);
|
||||
}
|
||||
};
|
||||
|
||||
let author = crate::git::git_log_oldest_author(comment_dir)?;
|
||||
let creation_time = crate::git::git_log_oldest_timestamp(comment_dir)?;
|
||||
let dir = std::path::PathBuf::from(comment_dir);
|
||||
|
||||
Ok(Self {
|
||||
uuid: String::from(dir.file_name().unwrap().to_string_lossy()),
|
||||
uuid: String::from(
|
||||
dir.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
),
|
||||
author,
|
||||
creation_time,
|
||||
description: description.unwrap(),
|
||||
description,
|
||||
dir: std::path::PathBuf::from(comment_dir),
|
||||
})
|
||||
}
|
||||
|
|
@ -109,7 +113,11 @@ impl Comment {
|
|||
&format!(
|
||||
"add comment {} on issue {}",
|
||||
comment.uuid,
|
||||
issue.dir.file_name().unwrap().to_string_lossy(),
|
||||
issue
|
||||
.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
),
|
||||
)?;
|
||||
}
|
||||
|
|
@ -130,10 +138,15 @@ impl Comment {
|
|||
crate::git::add(&description_filename)?;
|
||||
if crate::git::worktree_is_dirty(&self.dir.to_string_lossy())? {
|
||||
crate::git::commit(
|
||||
&description_filename.parent().unwrap(),
|
||||
&description_filename
|
||||
.parent()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?,
|
||||
&format!(
|
||||
"edit comment {} on issue FIXME", // FIXME: name the issue that the comment is on
|
||||
self.dir.file_name().unwrap().to_string_lossy()
|
||||
self.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy()
|
||||
),
|
||||
)?;
|
||||
self.read_description()?;
|
||||
|
|
@ -165,8 +178,8 @@ impl Comment {
|
|||
.spawn()?
|
||||
.wait_with_output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(CommentError::EditorError);
|
||||
}
|
||||
|
||||
|
|
|
|||
125
src/git.rs
125
src/git.rs
|
|
@ -48,8 +48,8 @@ impl Worktree {
|
|||
.args(["worktree", "add", &path.path().to_string_lossy(), branch])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(Self { path })
|
||||
|
|
@ -67,8 +67,8 @@ impl Worktree {
|
|||
])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(Self { path })
|
||||
|
|
@ -87,8 +87,8 @@ pub fn checkout_branch_in_worktree(
|
|||
.args(["worktree", "add", &worktree_dir.to_string_lossy(), branch])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(())
|
||||
|
|
@ -99,8 +99,8 @@ pub fn git_worktree_prune() -> Result<(), GitError> {
|
|||
.args(["worktree", "prune"])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(())
|
||||
|
|
@ -111,8 +111,8 @@ pub fn git_remove_branch(branch: &str) -> Result<(), GitError> {
|
|||
.args(["branch", "-D", branch])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(())
|
||||
|
|
@ -139,11 +139,14 @@ pub fn worktree_is_dirty(dir: &str) -> Result<bool, GitError> {
|
|||
pub fn add(file: &std::path::Path) -> Result<(), GitError> {
|
||||
let result = std::process::Command::new("git")
|
||||
.args(["add", &file.to_string_lossy()])
|
||||
.current_dir(file.parent().unwrap())
|
||||
.current_dir(
|
||||
file.parent()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?,
|
||||
)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
return Ok(());
|
||||
|
|
@ -152,11 +155,14 @@ pub fn add(file: &std::path::Path) -> Result<(), GitError> {
|
|||
pub fn restore_file(file: &std::path::Path) -> Result<(), GitError> {
|
||||
let result = std::process::Command::new("git")
|
||||
.args(["restore", &file.to_string_lossy()])
|
||||
.current_dir(file.parent().unwrap())
|
||||
.current_dir(
|
||||
file.parent()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?,
|
||||
)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
return Ok(());
|
||||
|
|
@ -168,8 +174,8 @@ pub fn commit(dir: &std::path::Path, msg: &str) -> Result<(), GitError> {
|
|||
.current_dir(dir)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(())
|
||||
|
|
@ -180,12 +186,18 @@ pub fn git_commit_file(file: &std::path::Path) -> Result<(), GitError> {
|
|||
git_dir.pop();
|
||||
|
||||
let result = std::process::Command::new("git")
|
||||
.args(["add", &file.file_name().unwrap().to_string_lossy()])
|
||||
.args([
|
||||
"add",
|
||||
&file
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
])
|
||||
.current_dir(&git_dir)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -195,15 +207,20 @@ pub fn git_commit_file(file: &std::path::Path) -> Result<(), GitError> {
|
|||
"-m",
|
||||
&format!(
|
||||
"update '{}' in issue {}",
|
||||
file.file_name().unwrap().to_string_lossy(),
|
||||
git_dir.file_name().unwrap().to_string_lossy()
|
||||
file.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
git_dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy()
|
||||
),
|
||||
])
|
||||
.current_dir(&git_dir)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -216,8 +233,8 @@ pub fn git_fetch(dir: &std::path::Path, remote: &str) -> Result<(), GitError> {
|
|||
.current_dir(dir)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
Ok(())
|
||||
|
|
@ -253,13 +270,13 @@ pub fn sync(dir: &std::path::Path, remote: &str, branch: &str) -> Result<(), Git
|
|||
"Sync failed! 'git log' error! Help, a human needs to fix the mess in {:?}",
|
||||
branch
|
||||
);
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
if result.stdout.len() > 0 {
|
||||
println!("Changes fetched from remote {}:", remote);
|
||||
println!("{}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("{}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("");
|
||||
}
|
||||
|
||||
|
|
@ -279,13 +296,13 @@ pub fn sync(dir: &std::path::Path, remote: &str, branch: &str) -> Result<(), Git
|
|||
"Sync failed! 'git log' error! Help, a human needs to fix the mess in {:?}",
|
||||
branch
|
||||
);
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
if result.stdout.len() > 0 {
|
||||
println!("Changes to push to remote {}:", remote);
|
||||
println!("{}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("{}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("");
|
||||
}
|
||||
|
||||
|
|
@ -299,8 +316,8 @@ pub fn sync(dir: &std::path::Path, remote: &str, branch: &str) -> Result<(), Git
|
|||
"Sync failed! Merge error! Help, a human needs to fix the mess in {:?}",
|
||||
branch
|
||||
);
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -314,8 +331,8 @@ pub fn sync(dir: &std::path::Path, remote: &str, branch: &str) -> Result<(), Git
|
|||
"Sync failed! Push error! Help, a human needs to fix the mess in {:?}",
|
||||
branch
|
||||
);
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -332,13 +349,16 @@ pub fn git_log_oldest_timestamp(
|
|||
"log",
|
||||
"--pretty=format:%at",
|
||||
"--",
|
||||
&path.file_name().unwrap().to_string_lossy(),
|
||||
&path
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
])
|
||||
.current_dir(&git_dir)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
let timestamp_str = std::str::from_utf8(&result.stdout).unwrap();
|
||||
|
|
@ -358,13 +378,16 @@ pub fn git_log_oldest_author(path: &std::path::Path) -> Result<String, GitError>
|
|||
"log",
|
||||
"--pretty=format:%an <%ae>",
|
||||
"--",
|
||||
&path.file_name().unwrap().to_string_lossy(),
|
||||
&path
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
])
|
||||
.current_dir(&git_dir)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
let author_str = std::str::from_utf8(&result.stdout).unwrap();
|
||||
|
|
@ -383,8 +406,8 @@ pub fn create_orphan_branch(branch: &str) -> Result<(), GitError> {
|
|||
.args(["worktree", "prune"])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -400,8 +423,8 @@ fn create_orphan_branch_at_path(
|
|||
.args(["worktree", "add", "--orphan", "-b", branch, &worktree_dir])
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -418,8 +441,8 @@ fn create_orphan_branch_at_path(
|
|||
.current_dir(worktree_path)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
@ -428,8 +451,8 @@ fn create_orphan_branch_at_path(
|
|||
.current_dir(worktree_path)
|
||||
.output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(GitError::Oops);
|
||||
}
|
||||
|
||||
|
|
|
|||
39
src/issue.rs
39
src/issue.rs
|
|
@ -153,9 +153,9 @@ impl Issue {
|
|||
}
|
||||
}
|
||||
|
||||
if description == None {
|
||||
let Some(description) = description else {
|
||||
return Err(IssueError::IssueParseError);
|
||||
}
|
||||
};
|
||||
|
||||
// parse the issue ID from the directory name
|
||||
let id = if let Some(parsed_id) = match dir.file_name() {
|
||||
|
|
@ -179,7 +179,7 @@ impl Issue {
|
|||
state: state,
|
||||
dependencies,
|
||||
assignee,
|
||||
description: description.unwrap(),
|
||||
description,
|
||||
comments,
|
||||
dir: std::path::PathBuf::from(dir),
|
||||
})
|
||||
|
|
@ -267,9 +267,9 @@ impl Issue {
|
|||
"edit description of issue {}",
|
||||
description_filename
|
||||
.parent()
|
||||
.unwrap()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.file_name()
|
||||
.unwrap()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
))?;
|
||||
Ok(())
|
||||
|
|
@ -293,7 +293,10 @@ impl Issue {
|
|||
write!(state_file, "{}", new_state)?;
|
||||
self.commit(&format!(
|
||||
"change state of issue {}, {} -> {}",
|
||||
self.dir.file_name().unwrap().to_string_lossy(),
|
||||
self.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
old_state,
|
||||
new_state,
|
||||
))?;
|
||||
|
|
@ -323,7 +326,10 @@ impl Issue {
|
|||
self.done_time = Some(done_time.clone());
|
||||
self.commit(&format!(
|
||||
"set done-time of issue {} to {}",
|
||||
self.dir.file_name().unwrap().to_string_lossy(),
|
||||
self.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
done_time,
|
||||
))?;
|
||||
Ok(())
|
||||
|
|
@ -341,7 +347,10 @@ impl Issue {
|
|||
write!(assignee_file, "{}", new_assignee)?;
|
||||
self.commit(&format!(
|
||||
"change assignee of issue {}, {} -> {}",
|
||||
self.dir.file_name().unwrap().to_string_lossy(),
|
||||
self.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
old_assignee,
|
||||
new_assignee,
|
||||
))?;
|
||||
|
|
@ -358,7 +367,10 @@ impl Issue {
|
|||
self.tags.sort();
|
||||
self.commit_tags(&format!(
|
||||
"issue {} add tag {}",
|
||||
self.dir.file_name().unwrap().to_string_lossy(),
|
||||
self.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
tag
|
||||
))?;
|
||||
Ok(())
|
||||
|
|
@ -373,7 +385,10 @@ impl Issue {
|
|||
self.tags.remove(index);
|
||||
self.commit_tags(&format!(
|
||||
"issue {} remove tag {}",
|
||||
self.dir.file_name().unwrap().to_string_lossy(),
|
||||
self.dir
|
||||
.file_name()
|
||||
.ok_or(std::io::Error::from(std::io::ErrorKind::NotFound))?
|
||||
.to_string_lossy(),
|
||||
tag
|
||||
))?;
|
||||
Ok(())
|
||||
|
|
@ -432,8 +447,8 @@ impl Issue {
|
|||
.spawn()?
|
||||
.wait_with_output()?;
|
||||
if !result.status.success() {
|
||||
println!("stdout: {}", std::str::from_utf8(&result.stdout).unwrap());
|
||||
println!("stderr: {}", std::str::from_utf8(&result.stderr).unwrap());
|
||||
println!("stdout: {}", &String::from_utf8_lossy(&result.stdout));
|
||||
println!("stderr: {}", &String::from_utf8_lossy(&result.stderr));
|
||||
return Err(IssueError::EditorError);
|
||||
}
|
||||
if !description_filename.exists() || description_filename.metadata()?.len() == 0 {
|
||||
|
|
|
|||
|
|
@ -56,8 +56,19 @@ impl Issues {
|
|||
for direntry in dir.read_dir()? {
|
||||
if let Ok(direntry) = direntry {
|
||||
if direntry.metadata()?.is_dir() {
|
||||
let issue = crate::issue::Issue::new_from_dir(direntry.path().as_path())?;
|
||||
issues.add_issue(issue);
|
||||
match crate::issue::Issue::new_from_dir(direntry.path().as_path()) {
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"failed to parse issue {}, skipping",
|
||||
direntry.file_name().to_string_lossy()
|
||||
);
|
||||
eprintln!("ignoring error: {:?}", e);
|
||||
continue;
|
||||
}
|
||||
Ok(issue) => {
|
||||
issues.add_issue(issue);
|
||||
}
|
||||
}
|
||||
} else if direntry.file_name() == "config.toml" {
|
||||
issues.parse_config(direntry.path().as_path())?;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue