mirror of
https://github.com/SukkaW/Surge.git
synced 2026-09-12 18:44:36 +08:00
Chore: embed content hash
This commit is contained in:
@@ -30,7 +30,7 @@ export const writeFile: Write = async (destination: string, input, dir = dirname
|
||||
return fsp.writeFile(destination, input, { encoding: 'utf-8' });
|
||||
};
|
||||
|
||||
export function withBannerArray(title: string, description: string[] | readonly string[], date: Date, content: string[]) {
|
||||
export function withBannerArray(title: string, description: string[] | readonly string[], date: Date, content: string[], contentHash: string | null = null) {
|
||||
const result: string[] = [
|
||||
'#########################################',
|
||||
`# ${title}`,
|
||||
@@ -40,6 +40,10 @@ export function withBannerArray(title: string, description: string[] | readonly
|
||||
|
||||
appendArrayInPlace(result, description.map(line => (line ? `# ${line}` : '#')));
|
||||
|
||||
if (contentHash) {
|
||||
result.push('#', `# ${contentHash}`);
|
||||
}
|
||||
|
||||
result.push('#########################################');
|
||||
|
||||
appendArrayInPlace(result, content);
|
||||
|
||||
Reference in New Issue
Block a user