Skip to content

Commit

Permalink
added support for linux and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
HYP3R00T committed Aug 8, 2024
1 parent 0678906 commit dd8a930
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
import * as vscode from "vscode";
import * as fs from "fs";
import * as path from "path";
import * as os from "os";

export function activate(context: vscode.ExtensionContext) {
let settings_organizer_global = vscode.commands.registerCommand(
"extension.settings-organizer-global",
() => {
const appData = process.env.APPDATA || process.env.HOME || "";
const userSettingsPath = path.join(
appData,
"Code",
"User",
"settings.json"
);
const platform = os.platform();
let userSettingsPath = "";

if (platform === "win32") {
userSettingsPath = path.join(
process.env.APPDATA || "",
"Code",
"User",
"settings.json"
);
} else if (platform === "darwin") {
userSettingsPath = path.join(
process.env.HOME || "",
"Library",
"Application Support",
"Code",
"User",
"settings.json"
);
} else if (platform === "linux") {
userSettingsPath = path.join(
process.env.HOME || "",
".config",
"Code",
"User",
"settings.json"
);
}

// Log the path for debugging
console.log(`Looking for settings.json at: ${userSettingsPath}`);
Expand Down

0 comments on commit dd8a930

Please sign in to comment.