Skip to content

Commit 1661351

Browse files
authored
Merge pull request #259 from doki-theme/insiders
Fixed assets not installing.
2 parents 02f9bda + 1f5bc6b commit 1661351

8 files changed

Lines changed: 379 additions & 357 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 88.5-1.6.4 [Bug Fixes]
4+
5+
- Restored the ability for the extension to load. Restore your assets, exit VSCode and start it again for this to take effect.
6+
37
## 88.5-1.6.3 [Bug Fixes]
48

59
- Restored the checksum fixes, so you do not see the "Your Code installation appears to be corrupt" message anymore. Restore your assets, exit VSCode and start it again for this to take effect.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Doki Theme",
44
"description": "Cute anime character themes!",
55
"publisher": "unthrottled",
6-
"version": "88.1.17",
6+
"version": "88.1.18",
77
"license": "MIT",
88
"icon": "Doki-Theme-v2.png",
99
"galleryBanner": {
@@ -1702,4 +1702,4 @@
17021702
"resolutions": {
17031703
"minimist": "0.2.1"
17041704
}
1705-
}
1705+
}

src/CheckSumService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const fixCheckSums = (extensionContext: vscode.ExtensionContext) => {
2929
false
3030
);
3131

32-
console.log(checksumChanged, productFile)
3332
if (checksumChanged) {
3433
const json = JSON.stringify(product, null, "\t");
3534
try {

src/ENV.ts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'path';
22
import fs from "fs";
3+
import {vscode} from './vsc'
34

45
export const ASSETS_URL = `https://doki.assets.unthrottled.io`;
56
export const VSCODE_ASSETS_URL = `${ASSETS_URL}/stickers/vscode`;
@@ -9,36 +10,43 @@ export const WALLPAPER_ASSETS_URL = `${ASSETS_URL}/backgrounds/wallpapers/transp
910
export const SCREENSHOT_ASSETS_URL = `${ASSETS_URL}/screenshots`;
1011

1112

12-
const main = require.main || { filename: 'yeet' };
13-
export const defaultWorkbenchDirectory = path.join(path.dirname(main.filename), 'vs', 'workbench');
14-
export const isWSL = () => !fs.existsSync(defaultWorkbenchDirectory);
13+
export const isWSL = () => !fs.existsSync(getDefaultWorkBenchDirectory());
14+
const getDefaultWorkBenchDirectory = () => {
15+
const mainFilename = require.main?.filename;
16+
const vscodeInstallationPath = vscode?.env.appRoot;
17+
const appRoot = mainFilename?.length ? path.dirname(mainFilename) : path.join(vscodeInstallationPath!, 'out');
18+
return path.join(appRoot, 'vs', 'workbench');
19+
};
1520

1621
const resolveWorkbench = () => {
1722
if (!isWSL()) {
18-
return defaultWorkbenchDirectory;
23+
return getDefaultWorkBenchDirectory();
1924
}
2025

21-
const usersPath = path.resolve('/mnt', 'c', 'Users');
22-
const users = fs.readdirSync(usersPath);
26+
try {
27+
const usersPath = path.resolve('/mnt', 'c', 'Users');
28+
const users = fs.readdirSync(usersPath);
2329

24-
return users.map(user => path.resolve(usersPath, user, 'AppData',
30+
return users.map(user => path.resolve(usersPath, user, 'AppData',
2531
'Local', 'Programs', 'Microsoft VS Code', 'resources',
2632
'app', 'out', 'vs', 'workbench'))
2733
.filter(path => fs.existsSync(path))
28-
.find(Boolean) || defaultWorkbenchDirectory;
29-
34+
.find(Boolean) || getDefaultWorkBenchDirectory();
35+
} catch (error) {
36+
return getDefaultWorkBenchDirectory();
37+
}
3038
};
3139

3240
export const workbenchDirectory = resolveWorkbench();
3341

3442
const REMOTE_CODE_SERVER_FILE = `web.main`;
3543
const CODE_SERVER_FILE = 'web.api';
3644
const getFileName = () => {
37-
if(fs.existsSync(path.join(workbenchDirectory, `workbench.web.main.css`))) {
45+
if (fs.existsSync(path.join(workbenchDirectory, `workbench.web.main.css`))) {
3846
return REMOTE_CODE_SERVER_FILE;
3947
}
4048

41-
const hasRegularVSCodeStuff = fs.existsSync(path.join(workbenchDirectory, `workbench.desktop.main.css`));
49+
const hasRegularVSCodeStuff = fs.existsSync(path.join(workbenchDirectory, `workbench.desktop.main.css`));
4250
return hasRegularVSCodeStuff ?
4351
'desktop.main' : CODE_SERVER_FILE;
4452
};

src/NotificationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { VSCodeGlobals } from "./VSCodeGlobals";
33
import { attemptToGreetUser } from "./WelcomeService";
44

55
const SAVED_VERSION = "doki.theme.version";
6-
const DOKI_THEME_VERSION = "v88.5-1.6.3";
6+
const DOKI_THEME_VERSION = "v88.5-1.6.4";
77

88
export function attemptToNotifyUpdates(context: vscode.ExtensionContext) {
99
const savedVersion = VSCodeGlobals.globalState.get(SAVED_VERSION);

src/vsc.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import VSCODE_BASE from 'vscode';
2+
3+
let vscode: typeof VSCODE_BASE | undefined;
4+
5+
try {
6+
vscode = require('vscode');
7+
} catch {
8+
// nothing todo
9+
}
10+
11+
export { vscode };

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
2+
33
"compilerOptions": {
44
"module": "commonjs",
55
"target": "es6",

0 commit comments

Comments
 (0)