We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffbaa1c commit 5bf5313Copy full SHA for 5bf5313
1 file changed
gts-cli/src/gen_common.rs
@@ -221,6 +221,16 @@ pub fn safe_canonicalize_nonexistent(path: &Path) -> Result<PathBuf> {
221
}
222
223
224
+ // Normalize to an absolute path so that canonical_ancestor is always absolute.
225
+ // This ensures starts_with(sandbox_root) comparisons work when the caller
226
+ // passes a relative output directory.
227
+ let path = if path.is_absolute() {
228
+ path.to_path_buf()
229
+ } else {
230
+ std::env::current_dir()?.join(path)
231
+ };
232
+ let path = path.as_path();
233
+
234
if path.exists() {
235
return Ok(path.canonicalize()?);
236
0 commit comments