Skip to content

Commit 997b9f6

Browse files
committed
symlink error fix
1 parent aae4aa5 commit 997b9f6

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

extensions_conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/path2.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const { EXT_CONFIGS_DIR, APPDATA_DIRNAME } = require('./Constants');
55

66
class path2
77
{
8+
// static __dirname = path.join(__dirname, APPDATA_DIRNAME);
89
static __dirname = path.join(app.getPath('appData'), APPDATA_DIRNAME);
10+
911
static config_location = path.join(path2.__dirname, EXT_CONFIGS_DIR);
1012

1113
static joinAppData(...dir) {return path.join(path2.__dirname, ...dir);}
@@ -15,14 +17,18 @@ class path2
1517
static already_required = false;
1618
}
1719

20+
1821
if (!path2.already_required)
1922
{
20-
console.log('creating dir',path2.config_location )
21-
try {fs.mkdirSync(path2.config_location, { recursive: true });}
22-
catch (e) {console.log("could not create path to", EXT_CONFIGS_DIR, "in", path2.__dirname, ".", )}
23-
if (!fs.existsSync(path.join(__dirname, '..', EXT_CONFIGS_DIR)))
24-
fs.symlinkSync(path2.config_location, path.join(__dirname, '..', EXT_CONFIGS_DIR));
25-
23+
app.whenReady().then(function ()
24+
{
25+
console.log('creating dir',path2.config_location )
26+
if (!fs.existsSync(path2.config_location))
27+
try {fs.mkdirSync(path2.config_location, { recursive: true });}
28+
catch (e) {console.log("could not create path to", EXT_CONFIGS_DIR, "in", path2.__dirname, ".", )}
29+
if (!fs.existsSync(path.join(__dirname, '..', EXT_CONFIGS_DIR)))
30+
fs.symlinkSync(path2.config_location, path.join(__dirname, '..', EXT_CONFIGS_DIR));
31+
});
2632
path2.already_required = true;
2733
}
2834

0 commit comments

Comments
 (0)