File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,24 @@ describe('demo app', function () {
19
19
20
20
const removeStoredPreferences = function ( ) {
21
21
const productName = require ( '../package' ) . productName
22
- const userDataPath = path . join ( process . env . HOME , 'Library' , 'Application Support' , productName )
22
+
23
+ let userDataPath = ''
24
+ switch ( process . platform ) {
25
+ case 'darwin' :
26
+ userDataPath = path . join ( process . env . HOME , 'Library' , 'Application Support' , productName )
27
+ break
28
+ case 'win32' :
29
+ userDataPath = path . join ( process . env . APPDATA , productName )
30
+ break
31
+ case 'freebsd' :
32
+ case 'linux' :
33
+ case 'sunos' :
34
+ userDataPath = path . join ( process . env . HOME , '.config' , productName )
35
+ break
36
+ default :
37
+ throw new Error ( `Unknown userDataPath path for platform ${ process . platform } ` )
38
+ }
39
+
23
40
try {
24
41
fs . unlinkSync ( path . join ( userDataPath , 'activeDemoButtonId.json' ) )
25
42
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments