Skip to content

Commit

Permalink
fix(core): ignore .nx changes when checking for uncommitted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless committed Apr 16, 2024
1 parent bda37f0 commit 97efb73
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { execSync } from 'child_process';

export function checkForUncommittedChanges() {
const gitResult = execSync(`git status --porcelain`);
if (gitResult.length > 0) {
const gitResult = execSync('git status --porcelain').toString();

const filteredResults = gitResult
.split('\n')
.filter((line) => !line.includes('.nx') && line.trim().length > 0);

if (filteredResults.length > 0) {
console.log('❗️ Careful!');
console.log('You have uncommitted changes in your repository.');
console.log('');
console.log(gitResult.toString());
console.log(filteredResults.join('\n').toString());
console.log('Please commit your changes before running the migrator!');
process.exit(1);
}
Expand Down

0 comments on commit 97efb73

Please sign in to comment.