Skip to content

Commit

Permalink
fix: 修复windows无法大概项目的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mohuishou committed Apr 2, 2021
1 parent a131789 commit b266984
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/vscode/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "830ef6d0",
"pluginName": "vscode",
"description": "快速搜索vscode历史项目并且在vscode中打开",
"version": "v3.0.1",
"version": "v3.0.2",
"preload": "dist/preload.js",
"author": "莫回首",
"homepage": "https://github.com/mohuishou/utools",
Expand Down
3 changes: 2 additions & 1 deletion plugins/vscode/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const config: IConfigItem[] = [
name: "shell",
label: "shell",
type: "input",
required: true,
required: false,
placeholder: "一般情况下无需修改,windows 请保持为空值",
default: defaultShell,
},
{
Expand Down
7 changes: 5 additions & 2 deletions plugins/vscode/src/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ export class VSCode implements Plugin {
}

select(item: ListItem) {
let cmd =
Setting.Get("shell") + ` '"${Setting.Get("code")}" --folder-uri "${item.description}"'`;
let cmd = `"${Setting.Get("code")}" --folder-uri "${item.description}"`;
let shell = Setting.Get("shell");
if (shell.trim()) {
cmd = shell + ` '${cmd}'`;
}
let res = execSync(cmd, { timeout: 3000 }).toString().trim().toLowerCase();
if (res !== "" && !res.toLowerCase().includes("timeout")) throw res.toString();

Expand Down

0 comments on commit b266984

Please sign in to comment.