File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -197,10 +197,18 @@ impl AmberCompiler {
197
197
}
198
198
199
199
let now = Local :: now ( ) . format ( "%Y-%m-%d %H:%M:%S" ) . to_string ( ) ;
200
- let header = include_str ! ( "header.sh" )
200
+ let raw_header = fs:: read_to_string (
201
+ env:: var ( "AMBER_HEADER" )
202
+ . unwrap_or ( "" . to_string ( ) ) . to_string ( ) )
203
+ . unwrap_or ( include_str ! ( "header.sh" ) . to_string ( ) ) ;
204
+ let header = raw_header
201
205
. replace ( "{{ version }}" , env ! ( "CARGO_PKG_VERSION" ) )
202
206
. replace ( "{{ date }}" , now. as_str ( ) ) ;
203
- Ok ( format ! ( "{}{}" , header, result) )
207
+ let footer = fs:: read_to_string (
208
+ env:: var ( "AMBER_FOOTER" )
209
+ . unwrap_or ( "" . to_string ( ) ) . to_string ( ) )
210
+ . unwrap_or ( "" . to_string ( ) ) ;
211
+ Ok ( format ! ( "{}{}{}" , header, result, footer) )
204
212
}
205
213
206
214
pub fn document ( & self , block : Block , meta : ParserMetadata , output : String ) {
You can’t perform that action at this time.
0 commit comments