cli: Always write parser.h in generate command

This commit is contained in:
Max Brunsfeld 2019-02-07 12:28:01 -08:00
parent acd30d4693
commit dac13af206

View file

@ -54,6 +54,11 @@ pub fn generate_parser_in_directory(
fs::create_dir_all(&repo_header_path)?;
fs::write(&repo_src_path.join("parser.c"), c_code)
.map_err(|e| format!("Failed to write parser.c: {}", e))?;
fs::write(
&repo_header_path.join("parser.h"),
tree_sitter::PARSER_HEADER,
)
.map_err(|e| format!("Failed to write parser.h: {}", e))?;
ensure_file(&repo_src_path.join("binding.cc"), || {
npm_files::binding_cc(&language_name)
})?;
@ -63,9 +68,6 @@ pub fn generate_parser_in_directory(
ensure_file(&repo_path.join("index.js"), || {
npm_files::index_js(&language_name)
})?;
ensure_file(&repo_header_path.join("parser.h"), || {
tree_sitter::PARSER_HEADER
})?;
Ok(())
}