Skip to content

Commit dd1fa20

Browse files
committed
error handling
1 parent 2a97e3e commit dd1fa20

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/main.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,6 @@ enum Command {
104104
}
105105

106106
fn main() {
107-
if let Err(e) = inner_main() {
108-
tracing::error!(error = ?e);
109-
std::process::exit(1);
110-
}
111-
std::process::exit(0);
112-
}
113-
114-
fn inner_main() -> Result<()> {
115-
// Run from the git root directory.
116-
let args = Args::parse();
117-
118107
tracing_subscriber::registry()
119108
// We don't need timestamps in the logs.
120109
.with(
@@ -130,6 +119,16 @@ fn inner_main() -> Result<()> {
130119
.from_env_lossy(),
131120
)
132121
.init();
122+
if let Err(e) = inner_main() {
123+
tracing::error!(error = ?e);
124+
std::process::exit(1);
125+
}
126+
std::process::exit(0);
127+
}
128+
129+
fn inner_main() -> Result<()> {
130+
// Run from the git root directory.
131+
let args = Args::parse();
133132

134133
let repo = canonicalize(
135134
run_git(&["rev-parse", "--show-toplevel"])?.output_or("No git directory found")?,

0 commit comments

Comments
 (0)