mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
codex: normalize schema fixture TS paths (#13593)
This commit is contained in:
@@ -1994,7 +1994,7 @@ pub(crate) fn generate_index_ts_tree(tree: &mut BTreeMap<PathBuf, String>) {
|
||||
.collect::<Vec<_>>();
|
||||
if !v2_entries.is_empty() {
|
||||
tree.insert(
|
||||
PathBuf::from("v2/index.ts"),
|
||||
PathBuf::from("v2").join("index.ts"),
|
||||
index_ts_entries(&v2_entries, false),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -277,6 +277,7 @@ fn collect_typescript_fixture_file<T: TS + 'static + ?Sized>(
|
||||
}
|
||||
|
||||
let contents = T::export_to_string().context("export TypeScript fixture content")?;
|
||||
let output_path = normalize_relative_fixture_path(&output_path);
|
||||
files.insert(
|
||||
output_path,
|
||||
contents.replace("\r\n", "\n").replace('\r', "\n"),
|
||||
@@ -295,6 +296,10 @@ fn collect_typescript_fixture_file<T: TS + 'static + ?Sized>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn normalize_relative_fixture_path(path: &Path) -> PathBuf {
|
||||
path.components().collect()
|
||||
}
|
||||
|
||||
fn visit_typescript_fixture_dependencies(
|
||||
files: &mut BTreeMap<PathBuf, String>,
|
||||
seen: &mut HashSet<TypeId>,
|
||||
|
||||
Reference in New Issue
Block a user