Skip to content

Commit

Permalink
feat(compile): add Amber version, fix amber-lang#181
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Jun 26, 2024
1 parent 88749b0 commit a0b371a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ impl AmberCompiler {
}
result.push(block.translate(&mut meta));
let res = result.join("\n");
format!("{}\n{}", include_str!("header.sh"), res)
let header = include_str!("header.sh");
format!("{}\n{}", &header.replace("|version|", option_env!("CARGO_PKG_VERSION").unwrap()), res)
}

pub fn compile(&self) -> Result<(Vec<Message>, String), Message> {
Expand Down
2 changes: 1 addition & 1 deletion src/header.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
# Written in [Amber](https://amber-lang.com/)
# Written in [Amber](https://amber-lang.com/) - |version|

0 comments on commit a0b371a

Please sign in to comment.