This commit is contained in:
Sidharth Vinod
2022-09-03 13:05:47 +05:30
parent c702e12a42
commit 6167eda6b6
48 changed files with 1442 additions and 1472 deletions

View File

@@ -6,6 +6,7 @@ import flatmap from 'unist-util-flatmap';
import { globby } from 'globby';
import { join, dirname } from 'path';
import { exec } from 'child_process';
import prettier from 'prettier';
const verify = process.argv.includes('--verify');
let fileChanged = false;
@@ -47,7 +48,10 @@ const transform = (file: string) => {
const transformed = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.\n${remark.stringify(
out
)}`;
verifyAndCopy(file, transformed);
verifyAndCopy(
file,
prettier.format(transformed, { parser: 'markdown', printWidth: 100, singleQuote: true })
);
};
(async () => {
@@ -64,7 +68,7 @@ const transform = (file: string) => {
);
process.exit(1);
}
console.log('Committing changes to the docs folder');
console.log('Adding changes in docs folder to git');
exec('git add docs');
}
})();