Skip to content

Commit fd3d79f

Browse files
azriel91ctron
authored andcommitted
Use dunce to canonicalize RtcCore.working_directory on initialization.
1 parent e9a8ae4 commit fd3d79f

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/config/rt/core.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ impl RtcCore {
2222

2323
let trunk_version = config.trunk_version.clone();
2424

25-
let working_directory = working_directory
26-
.canonicalize()
25+
let working_directory = dunce::canonicalize(&working_directory)
2726
.with_context(|| format!("unable to canonicalize '{}'", working_directory.display()))?;
2827

2928
let dist =

src/hooks.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ pub fn spawn_hooks(cfg: Arc<RtcBuild>, stage: PipelineStage) -> HookHandles {
1515
.filter(|hook_cfg| hook_cfg.stage == stage)
1616
.map(|hook_cfg| {
1717
let mut command = Command::new(hook_cfg.command());
18-
let current_dir = if cfg!(target_os = "windows") {
19-
dunce::simplified(&cfg.core.working_directory)
20-
} else {
21-
cfg.core.working_directory.as_path()
22-
};
2318

2419
command
25-
.current_dir(current_dir)
20+
.current_dir(&cfg.core.working_directory)
2621
.args(hook_cfg.command_arguments())
2722
.stdout(Stdio::inherit())
2823
.stderr(Stdio::inherit())

src/pipelines/tailwind_css.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,11 @@ impl TailwindCss {
111111
let rel_path = common::strip_prefix(&self.asset.path);
112112
tracing::debug!(path = ?rel_path, "compiling tailwind css");
113113

114-
let current_dir = if cfg!(target_os = "windows") {
115-
dunce::simplified(&self.cfg.core.working_directory)
116-
} else {
117-
self.cfg.core.working_directory.as_path()
118-
};
119114
common::run_command(
120115
Application::TailwindCss.name(),
121116
&tailwind,
122117
&args,
123-
current_dir,
118+
&self.cfg.core.working_directory,
124119
)
125120
.await?;
126121

0 commit comments

Comments
 (0)