Skip to content

Commit

Permalink
Merge pull request #259 from doki-theme/insiders
Browse files Browse the repository at this point in the history
Fixed assets not installing.
  • Loading branch information
Unthrottled authored Oct 6, 2024
2 parents 02f9bda + 1f5bc6b commit 1661351
Show file tree
Hide file tree
Showing 8 changed files with 379 additions and 357 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 88.5-1.6.4 [Bug Fixes]

- Restored the ability for the extension to load. Restore your assets, exit VSCode and start it again for this to take effect.

## 88.5-1.6.3 [Bug Fixes]

- 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.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Doki Theme",
"description": "Cute anime character themes!",
"publisher": "unthrottled",
"version": "88.1.17",
"version": "88.1.18",
"license": "MIT",
"icon": "Doki-Theme-v2.png",
"galleryBanner": {
Expand Down Expand Up @@ -1702,4 +1702,4 @@
"resolutions": {
"minimist": "0.2.1"
}
}
}
1 change: 0 additions & 1 deletion src/CheckSumService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const fixCheckSums = (extensionContext: vscode.ExtensionContext) => {
false
);

console.log(checksumChanged, productFile)
if (checksumChanged) {
const json = JSON.stringify(product, null, "\t");
try {
Expand Down
30 changes: 19 additions & 11 deletions src/ENV.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import fs from "fs";
import {vscode} from './vsc'

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


const main = require.main || { filename: 'yeet' };
export const defaultWorkbenchDirectory = path.join(path.dirname(main.filename), 'vs', 'workbench');
export const isWSL = () => !fs.existsSync(defaultWorkbenchDirectory);
export const isWSL = () => !fs.existsSync(getDefaultWorkBenchDirectory());
const getDefaultWorkBenchDirectory = () => {
const mainFilename = require.main?.filename;
const vscodeInstallationPath = vscode?.env.appRoot;
const appRoot = mainFilename?.length ? path.dirname(mainFilename) : path.join(vscodeInstallationPath!, 'out');
return path.join(appRoot, 'vs', 'workbench');
};

const resolveWorkbench = () => {
if (!isWSL()) {
return defaultWorkbenchDirectory;
return getDefaultWorkBenchDirectory();
}

const usersPath = path.resolve('/mnt', 'c', 'Users');
const users = fs.readdirSync(usersPath);
try {
const usersPath = path.resolve('/mnt', 'c', 'Users');
const users = fs.readdirSync(usersPath);

return users.map(user => path.resolve(usersPath, user, 'AppData',
return users.map(user => path.resolve(usersPath, user, 'AppData',
'Local', 'Programs', 'Microsoft VS Code', 'resources',
'app', 'out', 'vs', 'workbench'))
.filter(path => fs.existsSync(path))
.find(Boolean) || defaultWorkbenchDirectory;

.find(Boolean) || getDefaultWorkBenchDirectory();
} catch (error) {
return getDefaultWorkBenchDirectory();
}
};

export const workbenchDirectory = resolveWorkbench();

const REMOTE_CODE_SERVER_FILE = `web.main`;
const CODE_SERVER_FILE = 'web.api';
const getFileName = () => {
if(fs.existsSync(path.join(workbenchDirectory, `workbench.web.main.css`))) {
if (fs.existsSync(path.join(workbenchDirectory, `workbench.web.main.css`))) {
return REMOTE_CODE_SERVER_FILE;
}

const hasRegularVSCodeStuff = fs.existsSync(path.join(workbenchDirectory, `workbench.desktop.main.css`));
const hasRegularVSCodeStuff = fs.existsSync(path.join(workbenchDirectory, `workbench.desktop.main.css`));
return hasRegularVSCodeStuff ?
'desktop.main' : CODE_SERVER_FILE;
};
Expand Down
2 changes: 1 addition & 1 deletion src/NotificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { VSCodeGlobals } from "./VSCodeGlobals";
import { attemptToGreetUser } from "./WelcomeService";

const SAVED_VERSION = "doki.theme.version";
const DOKI_THEME_VERSION = "v88.5-1.6.3";
const DOKI_THEME_VERSION = "v88.5-1.6.4";

export function attemptToNotifyUpdates(context: vscode.ExtensionContext) {
const savedVersion = VSCodeGlobals.globalState.get(SAVED_VERSION);
Expand Down
11 changes: 11 additions & 0 deletions src/vsc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import VSCODE_BASE from 'vscode';

let vscode: typeof VSCODE_BASE | undefined;

try {
vscode = require('vscode');
} catch {
// nothing todo
}

export { vscode };
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{

"compilerOptions": {
"module": "commonjs",
"target": "es6",
Expand Down
Loading

0 comments on commit 1661351

Please sign in to comment.