Skip to content

Commit

Permalink
Fix file path for Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnLin013 committed Nov 2, 2017
1 parent 8ad0403 commit 6c3b54f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions extension.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6c3b54f

Please sign in to comment.