Skip to content

Commit 295c4e8

Browse files
committedNov 30, 2024
use wallbash cache instead of landig
1 parent 1c96d4b commit 295c4e8

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed
 

‎src/extension.ts

+17-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import * as os from 'os';
1111
import * as path from 'path';
1212
import * as vscode from 'vscode';
1313

14-
const walCachePath = path.join(
15-
os.homedir(), '.cache', 'hyde', 'landing', 'vscode-wallbash.json');
14+
const walCachePath =
15+
path.join(os.homedir(), '.cache', 'hyde', 'wallbash', 'code.json');
16+
1617
const targetPath = path.join(__dirname, '..', 'themes', 'wallbash.json');
1718
const XDG_CONFIG_HOME =
1819
process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config');
@@ -26,6 +27,12 @@ export function activate(context: vscode.ExtensionContext) {
2627

2728
context.subscriptions.push(disposable);
2829

30+
// Ensure the directory for walCachePath exists
31+
const walCacheDir = path.dirname(walCachePath);
32+
if (!fs.existsSync(walCacheDir)) {
33+
fs.mkdirSync(walCacheDir, {recursive: true});
34+
}
35+
2936
// Handle missing cache
3037
if (!fs.existsSync(walCachePath)) {
3138
fs.copyFile(targetPath, walCachePath, (err: NodeJS.ErrnoException|null) => {
@@ -124,8 +131,14 @@ function populateColorThemes() {
124131
*/
125132
function initializeWallTemplates(enableThemeMode: boolean) {
126133
// This is use for Old Hyprdots
127-
const td = fs.existsSync(path.join(XDG_CONFIG_HOME, 'hyde', 'wallbash', 'theme')) ? 'theme' : 'Wall-Dcol';
128-
const ad = fs.existsSync(path.join(XDG_CONFIG_HOME, 'hyde', 'wallbash', 'theme')) ? 'theme' : 'Wall-Ways';
134+
const td =
135+
fs.existsSync(path.join(XDG_CONFIG_HOME, 'hyde', 'wallbash', 'theme')) ?
136+
'theme' :
137+
'Wall-Dcol';
138+
const ad =
139+
fs.existsSync(path.join(XDG_CONFIG_HOME, 'hyde', 'wallbash', 'theme')) ?
140+
'theme' :
141+
'Wall-Ways';
129142

130143
const templateSource = path.join(__dirname, '..', 'wallbash', 'code.dcol');
131144
const wallWaysDir = path.join(XDG_CONFIG_HOME, 'hyde', 'wallbash', ad);

‎wallbash/code.dcol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
${cacheDir}/landing/vscode-wallbash.json
1+
${cacheDir}/wallbash/code.json
22
{
33
"colors": {
44
"focusBorder": "#<wallbash_1xa1>",

0 commit comments

Comments
 (0)
Please sign in to comment.