forked from tagspaces/tagspaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink-ext.ts
41 lines (36 loc) · 1023 Bytes
/
link-ext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import fs from 'fs';
import webpackPaths from '../.erb/configs/webpack.paths';
import path from 'path';
const { releasePath, rootPath } = webpackPaths;
// Link extensions
const srcExt = path.join(releasePath, 'app/node_modules/@tagspaces/extensions');
const targetExt = path.join(rootPath, 'public/modules/@tagspaces/extensions');
try {
if (fs.existsSync(targetExt)) {
fs.unlinkSync(targetExt);
}
} catch (err) {
console.error('Error removing file:' + targetExt, err);
}
if (fs.existsSync(srcExt)) {
fs.symlinkSync(srcExt, targetExt, 'junction');
}
// link Pro extensions
const srcProExt = path.join(
releasePath,
'app/node_modules/@tagspacespro/extensions',
);
const targetProExt = path.join(
rootPath,
'public/modules/@tagspacespro/extensions',
);
try {
if (fs.existsSync(targetProExt)) {
fs.unlinkSync(targetProExt);
}
} catch (err) {
console.error('Error removing file:' + targetProExt, err);
}
if (fs.existsSync(srcProExt)) {
fs.symlinkSync(srcProExt, targetProExt, 'junction');
}