Skip to content

Commit

Permalink
Use default double braces for templating
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Oct 16, 2019
1 parent 7ca9738 commit fcd56d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const ManualEnrollmentSteps: React.SFC<{ instructions: ManualEnrollmentIn
);

// Setup for replacing template variables in install instructions
const TEMPLATE_TAGS = ['{', '}'];
const mustacheWriter = new Writer();

// do not html escape output
Expand All @@ -56,14 +55,10 @@ mustacheWriter.escapedValue = function escapedValue(token, context) {
// Configure available variable values
export function replaceTemplateStrings(text: string = '') {
const variables = {
// '{' and '}' can not be used in template since they are used as template tags.
// Must use '{curlyOpen}'' and '{curlyClose}'
curlyOpen: '{',
curlyClose: '}',
config: {
enrollmentToken: 'sometesttoken',
},
};
mustacheWriter.parse(text, TEMPLATE_TAGS);
mustacheWriter.parse(text);
return mustacheWriter.render(text, variables, () => {});
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ setup.kibana:

export const START = `
./somefile setup
./somefile --token={config.enrollmentToken}
./somefile --token={{config.enrollmentToken}}
`;

0 comments on commit fcd56d3

Please sign in to comment.