Переглянути джерело

chore(cli): use unix path separator on $schema (#4384)

Lucas Fernandes Nogueira 3 роки тому
батько
коміт
010530459e
2 змінених файлів з 12 додано та 1 видалено
  1. 6 0
      .changes/fix-schema-path-fmt.md
  2. 6 1
      tooling/cli/src/init.rs

+ 6 - 0
.changes/fix-schema-path-fmt.md

@@ -0,0 +1,6 @@
+---
+"cli.js": patch
+"cli.rs": patch
+---
+
+Use UNIX path separator on the init `$schema` field.

+ 6 - 1
tooling/cli/src/init.rs

@@ -217,7 +217,12 @@ pub fn command(mut options: Options) -> Result<()> {
         let mut map = serde_json::Map::default();
         map.insert(
           "$schema".into(),
-          serde_json::Value::String(cli_node_module_path.display().to_string()),
+          serde_json::Value::String(
+            cli_node_module_path
+              .display()
+              .to_string()
+              .replace('\\', "/"),
+          ),
         );
         let merge_config = serde_json::Value::Object(map);
         json_patch::merge(&mut config, &merge_config);