Files
privacy.sexy/src/application/Context/State/Code/Generation/Languages/BatchBuilder.ts
2021-02-21 12:34:33 +01:00

17 lines
435 B
TypeScript

import { CodeBuilder } from '@/application/Context/State/Code/Generation/CodeBuilder';
export class BatchBuilder extends CodeBuilder {
protected getCommentDelimiter(): string {
return '::';
}
protected writeStandardOut(text: string): string {
return `echo ${escapeForEcho(text)}`;
}
}
function escapeForEcho(text: string) {
return text
.replace(/&/g, '^&')
.replace(/%/g, '%%');
}