diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 8bce74093..db16ea99a 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,4 +1,4 @@ { - "src/docs/**": ["GIT=true yarn docs:build"], + "src/docs/**": ["yarn docs:build --git"], "*.{ts,js,json,html,md}": ["eslint --fix", "prettier --write"] } diff --git a/src/docs.mts b/src/docs.mts index 37db30b04..76594c4bf 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -9,7 +9,7 @@ import { exec } from 'child_process'; import prettier from 'prettier'; const verify = process.argv.includes('--verify'); -const git = process.env.GIT === 'true'; +const git = process.argv.includes('--git'); let fileChanged = false; // Possible Improvement: combine with lint-staged to only copy files that have changed const prepareOutFile = (file: string): string => { @@ -76,8 +76,8 @@ const transform = (file: string) => { ); process.exit(1); } - console.log('Adding changes in docs folder to git'); if (git) { + console.log('Adding changes in docs folder to git'); exec('git add docs'); } }