From 6c3b54fc9f6d1fa957a86c80b23c3688edbc3496 Mon Sep 17 00:00:00 2001 From: Shawn Date: Thu, 2 Nov 2017 14:57:32 +0800 Subject: [PATCH 1/2] Fix file path for Ubuntu --- extension.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extension.js b/extension.js index 1efac4e..dd86937 100644 --- a/extension.js +++ b/extension.js @@ -1,11 +1,11 @@ const vscode = require('vscode'); const ncp = require("copy-paste"); +const path = require("path"); function activate(context) { let disposable = vscode.commands.registerCommand('extension.searchFileName', function (fileUri) { if (fileUri != undefined) { - var path = fileUri.fsPath.split("\"")[0]; - var name = path.split("\\")[path.split("\\").length - 1]; + var name = path.basename(fileUri.fsPath); ncp.copy(name, function() { vscode.commands.executeCommand('workbench.action.findInFiles'); vscode.commands.executeCommand('editor.action.clipboardPasteAction'); diff --git a/package.json b/package.json index 15d2cb4..b1aaac8 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "test": "node ./node_modules/vscode/bin/test" }, "dependencies": { - "copy-paste": "^1.2.0" + "copy-paste": "^1.3.0" }, "devDependencies": { "typescript": "^2.5.2", From 5e9e2000e9fbf25b5fab8798a22d1fa8187f6319 Mon Sep 17 00:00:00 2001 From: Shawn Date: Thu, 2 Nov 2017 21:14:35 +0800 Subject: [PATCH 2/2] Bump v0.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1aaac8..a664269 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "file-name-search", "displayName": "File Name Search", "description": "Quickly search file name over all files.", - "version": "0.0.1", + "version": "0.0.2", "publisher": "Shawn", "icon": "file-name-search-icon.png", "license": "MIT",