Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 64683e7

Browse files
committed
fix ci
1 parent d330913 commit 64683e7

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

‎src/commands/show.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { executeCommand } from "../utils/cpUtils";
99
import { DialogOptions, DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils";
1010
import { selectWorkspaceFolder } from "../utils/workspaceUtils";
1111
import * as list from "./list";
12-
import * as wsl from '../utils/wslUtils';
12+
import * as wsl from "../utils/wslUtils";
1313

1414
export async function showProblem(channel: vscode.OutputChannel, node?: LeetCodeNode): Promise<void> {
1515
if (!node) {
@@ -54,7 +54,7 @@ async function showProblemInternal(channel: vscode.OutputChannel, id: string): P
5454
const reg: RegExp = /\*SourceCode:\s*(.*)/;
5555
const match: RegExpMatchArray | null = result.match(reg);
5656
if (match && match.length >= 2) {
57-
const filePath = wsl.useWsl() ? wsl.toWinPath(match[1].trim()) : match[1].trim()
57+
const filePath = wsl.useWsl() ? wsl.toWinPath(match[1].trim()) : match[1].trim();
5858

5959
await vscode.window.showTextDocument(vscode.Uri.file(filePath), { preview: false });
6060
} else {

‎src/leetCodeManager.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { UserStatus } from "./shared";
77
import { leetCodeBinaryPath } from "./shared";
88
import { executeCommand } from "./utils/cpUtils";
99
import { DialogType, promptForOpenOutputChannel } from "./utils/uiUtils";
10-
import * as wsl from './utils/wslUtils'
10+
import * as wsl from "./utils/wslUtils"
1111

1212
export interface ILeetCodeManager extends EventEmitter {
1313
getLoginStatus(channel: vscode.OutputChannel): void;
@@ -46,7 +46,7 @@ class LeetCodeManager extends EventEmitter implements ILeetCodeManager {
4646
let result: string = "";
4747

4848
const childProc: cp.ChildProcess = wsl.useWsl()
49-
? cp.spawn("wsl", ['--','node', leetCodeBinaryPath, "user", "-l"], { shell: true })
49+
? cp.spawn("wsl", ["--","node", leetCodeBinaryPath, "user", "-l"], { shell: true })
5050
: cp.spawn("node", [leetCodeBinaryPath, "user", "-l"], { shell: true });
5151

5252
childProc.stdout.on("data", (data: string | Buffer) => {

‎src/shared.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import * as path from "path";
44
import * as vscode from "vscode";
5-
import * as wsl from './utils/wslUtils'
5+
import * as wsl from "./utils/wslUtils";
66

7-
let binPath = path.join(__dirname, "..", "..", "node_modules", "leetcode-cli", "bin", "leetcode")
7+
let binPath = path.join(__dirname, "..", "..", "node_modules", "leetcode-cli", "bin", "leetcode");
88

99
if (wsl.useWsl()) {
10-
binPath = wsl.toWslPath(binPath)
10+
binPath = wsl.toWslPath(binPath);
1111
}
1212

1313
export const leetCodeBinaryPath: string = `"${binPath}"`;

‎src/utils/cpUtils.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
import * as cp from "child_process";
44
import * as vscode from "vscode";
5-
import * as wsl from './wslUtils'
5+
import * as wsl from "./wslUtils"
66

77
export async function executeCommand(channel: vscode.OutputChannel, command: string, args: string[], options: cp.SpawnOptions = { shell: true }): Promise<string> {
88
return new Promise((resolve: (res: string) => void, reject: (e: Error) => void): void => {
99
let result: string = "";
1010

1111
const childProc: cp.ChildProcess = wsl.useWsl()
12-
? cp.spawn('wsl', ['--', command].concat(args), options)
12+
? cp.spawn("wsl", ["--", command].concat(args), options)
1313
: cp.spawn(command, args, options);
1414

1515
childProc.stdout.on("data", (data: string | Buffer) => {

‎src/utils/workspaceUtils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function selectWorkspaceFolder(): Promise<string> {
1919

2020
const workFolder = folder ? folder.uri.fsPath : path.join(os.homedir(), ".leetcode");
2121

22-
return wsl.useWsl() ? wsl.toWslPath(workFolder) : workFolder
22+
return wsl.useWsl() ? wsl.toWslPath(workFolder) : workFolder;
2323
}
2424

2525
export async function getActivefilePath(uri?: vscode.Uri): Promise<string | undefined> {

‎src/utils/wslUtils.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import * as vscode from "vscode";
66
export function useWsl(): boolean {
77
const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
88

9-
return process.platform === 'win32' && leetCodeConfig.get<boolean>('useWsl') === true
9+
return process.platform === "win32" && leetCodeConfig.get<boolean>("useWsl") === true;
1010
}
1111

1212
export function toWslPath(path: string): string {
13-
return cp.execFileSync('wsl', ['--','wslpath','-u', `${path.replace(/\\/g, '/')}`]).toString().trim()
13+
return cp.execFileSync("wsl", ["--","wslpath","-u", `${path.replace(/\\/g, "/")}`]).toString().trim();
1414
}
1515

1616
export function toWinPath(path: string): string {
17-
return cp.execFileSync('wsl', ['--','wslpath','-w', path]).toString().trim()
17+
return cp.execFileSync("wsl", ["--","wslpath","-w", path]).toString().trim();
1818
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /