Skip to content

Commit 2c3bab9

Browse files
committed
Fixes from testing
Issues that have fallen through cracks
1 parent 50bcd4e commit 2c3bab9

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/bin/thag_cargo.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*[toml]
22
[dependencies]
3-
atty = "0.2.14"
43
thag_proc_macros = { version = "0.2, thag-auto" }
54
thag_common = { version = "0.2, thag-auto" }
65
*/
@@ -14,9 +13,8 @@ thag_common = { version = "0.2, thag-auto" }
1413
#[allow(clippy::single_component_path_imports)]
1514
use inquire;
1615
use std::{error::Error, path::PathBuf, process::Command};
17-
use thag_common::{auto_help, help_system::check_help_and_exit};
16+
use thag_common::{auto_help, help_system::check_help_and_exit, ThagCommonError};
1817
use thag_proc_macros::file_navigator;
19-
use thag_rs::tool_errors::ToolError;
2018

2119
file_navigator! {}
2220

@@ -192,8 +190,9 @@ fn main() -> Result<(), Box<dyn Error>> {
192190
ScriptMode::Interactive => {
193191
// Use the file selector
194192
let mut navigator = FileNavigator::new();
195-
select_file(&mut navigator, Some("rs"), false)
196-
.map_err(|e| ToolError::ThreadSafe(format!("Failed to select file: {e}",).into()))?
193+
select_file(&mut navigator, Some("rs"), false).map_err(|e| {
194+
ThagCommonError::Generic(format!("Failed to select file: {e}",).into())
195+
})?
197196
}
198197
};
199198

src/bin/thag_expand.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*[toml]
22
[dependencies]
3-
thag_rs = { version = "0.2, thag-auto", features = ["tools"] }
3+
thag_common = { version = "0.2, thag-auto" }
4+
thag_styling = { version = "0.2, thag-auto", features = ["inquire_theming"] }
45
*/
56

67
/// Useful front-end for `thag --cargo <script> --expand`, which in turn uses `cargo-expand` to show the macro expansion
@@ -21,9 +22,9 @@ use std::{
2122
process::{Command, Stdio},
2223
};
2324
use tempfile::tempdir;
24-
use thag_rs::{
25+
use thag_common::ThagCommonError;
26+
use thag_styling::{
2527
auto_help, file_navigator, help_system::check_help_and_exit, themed_inquire_config,
26-
tool_errors::ToolError,
2728
};
2829

2930
file_navigator! {}
@@ -96,8 +97,9 @@ fn expand_script() -> Result<()> {
9697
ScriptMode::Interactive => {
9798
// Use the file selector
9899
let mut navigator = FileNavigator::new();
99-
select_file(&mut navigator, Some("rs"), false)
100-
.map_err(|e| ToolError::ThreadSafe(format!("Failed to select file: {e}",).into()))?
100+
select_file(&mut navigator, Some("rs"), false).map_err(|e| {
101+
ThagCommonError::Generic(format!("Failed to select file: {e}",).into())
102+
})?
101103
}
102104
};
103105
if !input_path.exists() {

src/bin/thag_to_rust_script.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//# Categories: crates, tools
44
use std::io::{self, Read, Write};
55

6-
use thag_rs::{auto_help, help_system::check_help_and_exit};
6+
use thag_common::{auto_help, help_system::check_help_and_exit};
77
fn read_stdin() -> Result<String, io::Error> {
88
let mut buffer = String::new();
99
io::stdin().lock().read_to_string(&mut buffer)?;

0 commit comments

Comments
 (0)