@rehpic/vcli 0.1.0-beta.53.1 → 0.1.0-beta.54.1
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.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { execFileSync } from 'child_process';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
copyFileSync,
|
|
6
|
+
existsSync,
|
|
7
|
+
mkdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
rmSync,
|
|
10
|
+
writeFileSync,
|
|
11
|
+
} from 'fs';
|
|
5
12
|
import { dirname, join, resolve } from 'path';
|
|
6
13
|
import { fileURLToPath } from 'url';
|
|
7
14
|
|
|
8
15
|
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
9
16
|
const packageDir = resolve(scriptDir, '..');
|
|
10
17
|
const sourceFile = join(packageDir, 'macos', 'VectorMenuBar.swift');
|
|
18
|
+
const repoRoot = resolve(packageDir, '..', '..');
|
|
19
|
+
const menuBarIcon1x = join(
|
|
20
|
+
repoRoot,
|
|
21
|
+
'cli',
|
|
22
|
+
'macos',
|
|
23
|
+
'assets',
|
|
24
|
+
'vector-menubar.png',
|
|
25
|
+
);
|
|
26
|
+
const menuBarIcon2x = join(
|
|
27
|
+
repoRoot,
|
|
28
|
+
'cli',
|
|
29
|
+
'macos',
|
|
30
|
+
'assets',
|
|
31
|
+
'vector-menubar@2x.png',
|
|
32
|
+
);
|
|
11
33
|
const nativeDir = join(packageDir, 'native');
|
|
12
34
|
const appDir = join(nativeDir, 'VectorMenuBar.app');
|
|
13
35
|
const contentsDir = join(appDir, 'Contents');
|
|
@@ -24,6 +46,10 @@ if (!existsSync(sourceFile)) {
|
|
|
24
46
|
throw new Error(`Missing Swift source: ${sourceFile}`);
|
|
25
47
|
}
|
|
26
48
|
|
|
49
|
+
if (!existsSync(menuBarIcon1x) || !existsSync(menuBarIcon2x)) {
|
|
50
|
+
throw new Error('Missing Vector menu bar icon assets.');
|
|
51
|
+
}
|
|
52
|
+
|
|
27
53
|
rmSync(appDir, { recursive: true, force: true });
|
|
28
54
|
mkdirSync(macOSDir, { recursive: true });
|
|
29
55
|
mkdirSync(resourcesDir, { recursive: true });
|
|
@@ -48,6 +74,8 @@ execFileSync(
|
|
|
48
74
|
);
|
|
49
75
|
execFileSync('chmod', ['+x', executablePath], { stdio: 'inherit' });
|
|
50
76
|
rmSync(buildDir, { recursive: true, force: true });
|
|
77
|
+
copyFileSync(menuBarIcon1x, join(resourcesDir, 'vector-menubar.png'));
|
|
78
|
+
copyFileSync(menuBarIcon2x, join(resourcesDir, 'vector-menubar@2x.png'));
|
|
51
79
|
|
|
52
80
|
writeFileSync(
|
|
53
81
|
join(contentsDir, 'Info.plist'),
|