parent
d9587f2d42
commit
bc441273d1
@ -1,67 +0,0 @@
|
|||||||
From 136a745c5de804ee9cf0ec601302e17cef6334a3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Raits <i.gnatenko.brain@gmail.com>
|
|
||||||
Date: Sun, 22 Mar 2020 16:27:35 +0100
|
|
||||||
Subject: [PATCH] chore: Update liquid to 0.20
|
|
||||||
|
|
||||||
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
|
|
||||||
---
|
|
||||||
build.rs | 31 +++++++------------------------
|
|
||||||
1 file changed, 7 insertions(+), 24 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/build.rs b/build.rs
|
|
||||||
index 1c5872e..bff88e9 100644
|
|
||||||
--- a/build.rs
|
|
||||||
+++ b/build.rs
|
|
||||||
@@ -18,34 +18,13 @@ lazy_static! {
|
|
||||||
.unwrap_or("bat");
|
|
||||||
}
|
|
||||||
|
|
||||||
-fn init_template() -> liquid::value::Object {
|
|
||||||
- let mut globals = liquid::value::Object::new();
|
|
||||||
-
|
|
||||||
- globals.insert(
|
|
||||||
- "PROJECT_NAME".into(),
|
|
||||||
- liquid::value::Value::scalar(PROJECT_NAME.to_owned()),
|
|
||||||
- );
|
|
||||||
-
|
|
||||||
- globals.insert(
|
|
||||||
- "PROJECT_EXECUTABLE".into(),
|
|
||||||
- liquid::value::Value::scalar(EXECUTABLE_NAME.to_owned()),
|
|
||||||
- );
|
|
||||||
-
|
|
||||||
- globals.insert(
|
|
||||||
- "PROJECT_VERSION".into(),
|
|
||||||
- liquid::value::Value::scalar(PROJECT_VERSION.to_owned()),
|
|
||||||
- );
|
|
||||||
-
|
|
||||||
- globals
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
/// Generates a file from a liquid template.
|
|
||||||
fn template(
|
|
||||||
- variables: &liquid::value::Object,
|
|
||||||
+ variables: &liquid::Object,
|
|
||||||
in_file: &str,
|
|
||||||
out_file: impl AsRef<Path>,
|
|
||||||
) -> Result<(), Box<dyn Error>> {
|
|
||||||
- let template = liquid::ParserBuilder::with_liquid()
|
|
||||||
+ let template = liquid::ParserBuilder::with_stdlib()
|
|
||||||
.build()?
|
|
||||||
.parse(&fs::read_to_string(in_file)?)?;
|
|
||||||
|
|
||||||
@@ -54,7 +33,11 @@ fn template(
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn Error>> {
|
|
||||||
- let variables = init_template();
|
|
||||||
+ let variables = liquid::object!({
|
|
||||||
+ "PROJECT_NAME": PROJECT_NAME.to_owned(),
|
|
||||||
+ "PROJECT_EXECUTABLE": EXECUTABLE_NAME.to_owned(),
|
|
||||||
+ "PROJECT_VERSION": PROJECT_VERSION.to_owned(),
|
|
||||||
+ });
|
|
||||||
|
|
||||||
let out_dir_env = std::env::var_os("OUT_DIR").expect("OUT_DIR to be set in build.rs");
|
|
||||||
let out_dir = Path::new(&out_dir_env);
|
|
||||||
--
|
|
||||||
2.26.0.rc2
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
--- bat-0.13.0/Cargo.toml 2020-03-22T12:44:46+00:00
|
|
||||||
+++ bat-0.13.0/Cargo.toml 2020-03-23T06:22:32.294574+00:00
|
|
||||||
@@ -92,4 +92,4 @@
|
|
||||||
version = "1.4"
|
|
||||||
|
|
||||||
[build-dependencies.liquid]
|
|
||||||
-version = "0.19"
|
|
||||||
+version = "0.20"
|
|
@ -1 +1 @@
|
|||||||
SHA512 (bat-0.13.0.crate) = 950a54f8fcc8f8ef5f63e4ec4897e9dc32f39aa8965a3afba4501f1f58ad7d84d8aa34a8af3615c30112658e2fe59a3ccffbc6d1142ad2de24b650894e908c10
|
SHA512 (bat-0.14.0.crate) = b0da0513b82590cfa799b93fb1160373a3cdfb7b5d7189b3dce4e060a658a1dab96997646c6cd5a0631eb074512cb370b5c1db8edf95b0dd33ec61c3a13d5277
|
||||||
|
Loading…
Reference in new issue