mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-10 02:49:40 +02:00
Fail commit if docs changed
This commit is contained in:
@@ -5,6 +5,7 @@ import { readFileSync, writeFileSync, mkdirSync, copyFileSync, existsSync } from
|
|||||||
import flatmap from 'unist-util-flatmap';
|
import flatmap from 'unist-util-flatmap';
|
||||||
import { globby } from 'globby';
|
import { globby } from 'globby';
|
||||||
import { join, dirname } from 'path';
|
import { join, dirname } from 'path';
|
||||||
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
let fileChanged = false;
|
let fileChanged = false;
|
||||||
// Possible Improvement: combine with lint-staged to only copy files that have changed
|
// Possible Improvement: combine with lint-staged to only copy files that have changed
|
||||||
@@ -61,6 +62,7 @@ const transform = (file: string) => {
|
|||||||
});
|
});
|
||||||
if (fileChanged) {
|
if (fileChanged) {
|
||||||
console.log('Please commit the changes to the docs folder');
|
console.log('Please commit the changes to the docs folder');
|
||||||
|
exec('git add docs');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
Reference in New Issue
Block a user