From b6d0d7fe154aa6c78bcd983abd45311b9c900373 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 3 Sep 2022 09:52:29 +0530 Subject: [PATCH] Fail commit if docs changed --- src/docs.mts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/docs.mts b/src/docs.mts index b1096d08a..84bb81d63 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -5,6 +5,7 @@ import { readFileSync, writeFileSync, mkdirSync, copyFileSync, existsSync } from import flatmap from 'unist-util-flatmap'; import { globby } from 'globby'; import { join, dirname } from 'path'; +import { exec } from 'child_process'; let fileChanged = false; // Possible Improvement: combine with lint-staged to only copy files that have changed @@ -61,6 +62,7 @@ const transform = (file: string) => { }); if (fileChanged) { console.log('Please commit the changes to the docs folder'); + exec('git add docs'); process.exit(1); } })();