Skip to content

Commit

Permalink
fix: remove npm-merge-driver too
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Nov 9, 2020
1 parent 0dac6aa commit 7539ffb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ spawnSync(
{cwd: rootDir}
);

spawnSync(
'git',
['config', '--local', '--remove-section', 'merge.npm-merge-driver'],
{cwd: rootDir}
);

const attrFile = path.join(rootDir, '.git', 'info', 'attributes');

// remove git attributes
Expand All @@ -25,11 +31,12 @@ if (fs.existsSync(attrFile)) {

try {
const RE = new RegExp('.* merge\\s*=\\s*npm-merge-driver-install$');
const RE2 = new RegExp('.* merge\\s*=\\s*npm-merge-driver$');

attrContents = fs
.readFileSync(attrFile, 'utf8')
.split(/\r?\n/)
.filter(line => !line.match(RE))
.filter(line => !line.match(RE) && !line.match(RE2))
.join('\n');
} catch (e) {
// some issue we cannot handle
Expand Down

0 comments on commit 7539ffb

Please sign in to comment.