From d01e2eda8229ba34745135afee06636b485cbcc6 Mon Sep 17 00:00:00 2001 From: Adrian Sieber Date: Thu, 22 Feb 2024 14:24:23 +0000 Subject: [PATCH] Include Oclis version number in generated files --- purescript/src/Oclis/Executor.purs | 2 +- purescript/src/Oclis/Parser.purs | 2 +- purescript/src/Oclis/Tokenizer.purs | 2 +- purescript/src/Oclis/Types.purs | 2 +- purescript/src/Oclis/readme.md | 2 +- src/main.rs | 5 ++++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/purescript/src/Oclis/Executor.purs b/purescript/src/Oclis/Executor.purs index f92a391..aff5499 100644 --- a/purescript/src/Oclis/Executor.purs +++ b/purescript/src/Oclis/Executor.purs @@ -1,5 +1,5 @@ -- | CAUTION: --- | THIS FILE WAS GENERATED BASED ON `oclis.ncl`. +-- | THIS FILE WAS GENERATED BY Oclis {{version}} BASED ON `oclis.ncl`. -- | DO NOT EDIT MANUALLY! module Oclis where diff --git a/purescript/src/Oclis/Parser.purs b/purescript/src/Oclis/Parser.purs index 0f2f05b..0d77a74 100644 --- a/purescript/src/Oclis/Parser.purs +++ b/purescript/src/Oclis/Parser.purs @@ -1,5 +1,5 @@ -- | CAUTION: --- | THIS FILE WAS GENERATED BASED ON `oclis.ncl`. +-- | THIS FILE WAS GENERATED BY Oclis {{version}} BASED ON `oclis.ncl`. -- | DO NOT EDIT MANUALLY! module Oclis.Parser where diff --git a/purescript/src/Oclis/Tokenizer.purs b/purescript/src/Oclis/Tokenizer.purs index f18ffe2..278d3cf 100644 --- a/purescript/src/Oclis/Tokenizer.purs +++ b/purescript/src/Oclis/Tokenizer.purs @@ -1,5 +1,5 @@ -- | CAUTION: --- | THIS FILE WAS GENERATED BASED ON `oclis.ncl`. +-- | THIS FILE WAS GENERATED BY Oclis {{version}} BASED ON `oclis.ncl`. -- | DO NOT EDIT MANUALLY! module Oclis.Tokenizer diff --git a/purescript/src/Oclis/Types.purs b/purescript/src/Oclis/Types.purs index c03cbb6..b0bc2fa 100644 --- a/purescript/src/Oclis/Types.purs +++ b/purescript/src/Oclis/Types.purs @@ -1,5 +1,5 @@ -- | CAUTION: --- | THIS FILE WAS GENERATED BASED ON `oclis.ncl`. +-- | THIS FILE WAS GENERATED BY Oclis {{version}} BASED ON `oclis.ncl`. -- | DO NOT EDIT MANUALLY! module Oclis.Types where diff --git a/purescript/src/Oclis/readme.md b/purescript/src/Oclis/readme.md index c0fb6c9..7a575a7 100644 --- a/purescript/src/Oclis/readme.md +++ b/purescript/src/Oclis/readme.md @@ -1,5 +1,5 @@ > [!CAUTION] -> THIS FILE WAS GENERATED BASED ON `oclis.ncl`. \ +> THIS FILE WAS GENERATED BY Oclis {{version}} BASED ON `oclis.ncl`. \ > DO NOT EDIT MANUALLY! # Oclis diff --git a/src/main.rs b/src/main.rs index 721d601..6d75865 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,8 @@ use nickel_lang_core::error::report::ErrorFormat; use nickel_lang_core::serialize::{to_string, ExportFormat}; use nickel_lang_core::{eval::cache::CacheImpl, program::Program}; +const VERSION: &str = env!("CARGO_PKG_VERSION"); + #[derive(Parser)] #[command(version, about, long_about = None)] struct Cli { @@ -80,7 +82,8 @@ macro_rules! include_and_write_file { ($filename:expr) => {{ std::fs::write( concat!(OCLIS_SRC!(), $filename), - include_str!(concat!("../purescript/", OCLIS_SRC!(), $filename)), + include_str!(concat!("../purescript/", OCLIS_SRC!(), $filename)) + .replace("{{version}}", VERSION), )?; }}; }