Skip to content

Commit 6809cf9

Browse files
committed
remove settings dir before starting
1 parent 81ad1dd commit 6809cf9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/compass-e2e-tests/installers/mac-dmg.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import { existsSync } from 'fs';
23
import type { InstalledAppInfo, Package } from './types';
34
import { execute } from './helpers';
@@ -35,8 +36,19 @@ export async function installMacDMG(
3536
'--version',
3637
]);
3738

38-
// by my calculations this should crash
39-
await execute(`/Applications/${appName}.app/Contents/MacOS/${appName}`, []);
39+
if (process.env.HOME) {
40+
const settingsDir = path.resolve(
41+
process.env.HOME,
42+
'Library',
43+
'Application Support',
44+
appName
45+
);
46+
47+
if (existsSync(settingsDir)) {
48+
console.log(`${settingsDir} already exists. Removing.`);
49+
await execute('rm', ['-rf', settingsDir]);
50+
}
51+
}
4052

4153
return Promise.resolve({
4254
appName,

0 commit comments

Comments
 (0)