inskea 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/scripts/postinstall.js +10 -6
- package/scripts/preuninstall.js +27 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inskea",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Inskea - infinite-canvas vector illustration app",
|
|
5
5
|
"bin": {
|
|
6
6
|
"inskea": "bin/inskea.js"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"preuninstall": "node scripts/preuninstall.js"
|
|
11
11
|
},
|
|
12
12
|
"optionalDependencies": {
|
|
13
|
-
"@quippy/inskea-linux-x64": "2.1.
|
|
14
|
-
"@quippy/inskea-win32-x64": "2.1.
|
|
13
|
+
"@quippy/inskea-linux-x64": "2.1.3",
|
|
14
|
+
"@quippy/inskea-win32-x64": "2.1.3"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"inskea",
|
package/scripts/postinstall.js
CHANGED
|
@@ -6,10 +6,14 @@ const path = require('path');
|
|
|
6
6
|
const { execSync } = require('child_process');
|
|
7
7
|
|
|
8
8
|
function installLinux() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
9
|
+
// If running with root/sudo, install to standard system-wide /usr/local/share so it is available to ALL users on the machine.
|
|
10
|
+
// Otherwise, install to standard user-level ~/.local/share.
|
|
11
|
+
const isRoot = typeof process.getuid === 'function' && process.getuid() === 0;
|
|
12
|
+
const baseDir = isRoot ? '/usr/local/share' : path.join(os.homedir(), '.local', 'share');
|
|
13
|
+
|
|
14
|
+
const appsDir = path.join(baseDir, 'applications');
|
|
15
|
+
const iconsDir = path.join(baseDir, 'icons', 'hicolor', '128x128', 'apps');
|
|
16
|
+
const mimeDir = path.join(baseDir, 'mime', 'packages');
|
|
13
17
|
|
|
14
18
|
fs.mkdirSync(appsDir, { recursive: true });
|
|
15
19
|
fs.mkdirSync(iconsDir, { recursive: true });
|
|
@@ -30,7 +34,7 @@ function installLinux() {
|
|
|
30
34
|
if (fs.existsSync(mimeSrc)) {
|
|
31
35
|
fs.copyFileSync(mimeSrc, mimeDest);
|
|
32
36
|
try {
|
|
33
|
-
execSync(`update-mime-database "${path.join(
|
|
37
|
+
execSync(`update-mime-database "${path.join(baseDir, 'mime')}"`, { stdio: 'ignore' });
|
|
34
38
|
} catch (_) {}
|
|
35
39
|
}
|
|
36
40
|
|
|
@@ -44,7 +48,7 @@ function installLinux() {
|
|
|
44
48
|
} catch (_) {}
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
console.log(
|
|
51
|
+
console.log(`[inskea] Registered desktop launcher in ${appsDir}`);
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
function installWindows() {
|
package/scripts/preuninstall.js
CHANGED
|
@@ -6,27 +6,33 @@ const path = require('path');
|
|
|
6
6
|
const { execSync } = require('child_process');
|
|
7
7
|
|
|
8
8
|
function removeLinux() {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
fs.unlinkSync(
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
const dirs = [
|
|
10
|
+
'/usr/local/share',
|
|
11
|
+
path.join(os.homedir(), '.local', 'share')
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
for (const baseDir of dirs) {
|
|
15
|
+
const desktopFile = path.join(baseDir, 'applications', 'inskea.desktop');
|
|
16
|
+
const iconFile = path.join(baseDir, 'icons', 'hicolor', '128x128', 'apps', 'inskea.png');
|
|
17
|
+
const mimeFile = path.join(baseDir, 'mime', 'packages', 'inskea.xml');
|
|
18
|
+
|
|
19
|
+
if (fs.existsSync(desktopFile)) {
|
|
20
|
+
try {
|
|
21
|
+
fs.unlinkSync(desktopFile);
|
|
22
|
+
execSync(`update-desktop-database "${path.join(baseDir, 'applications')}"`, { stdio: 'ignore' });
|
|
23
|
+
} catch (_) {}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (fs.existsSync(iconFile)) {
|
|
27
|
+
try { fs.unlinkSync(iconFile); } catch (_) {}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (fs.existsSync(mimeFile)) {
|
|
31
|
+
try {
|
|
32
|
+
fs.unlinkSync(mimeFile);
|
|
33
|
+
execSync(`update-mime-database "${path.join(baseDir, 'mime')}"`, { stdio: 'ignore' });
|
|
34
|
+
} catch (_) {}
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
|