Skip to content

Commit

Permalink
Replace tilde (#11)
Browse files Browse the repository at this point in the history
Resolves #10
  • Loading branch information
mvdnbrk authored Sep 24, 2020
1 parent 1479b5c commit 3f7e2a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@types/mocha": "^2.2.42"
},
"dependencies": {
"find-up": "^4.1.0"
"find-up": "^4.1.0",
"untildify": "^4.0.0"
}
}
3 changes: 3 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as vscode from 'vscode'

const { lstatSync, readdirSync } = require('fs')
const { join, relative } = require('path')
const untildify = require('untildify');

export function activate(context: vscode.ExtensionContext) {
if (!vscode.workspace.workspaceFolders) return
Expand Down Expand Up @@ -120,6 +121,8 @@ function config(setting, fallback) {
}

function normalizePath(path) {
path = untildify(path)

path = path.replace('/c:/', 'c:/').replace('/C:/', 'C:/')

// Convert backslashes from windows paths to forward slashes, otherwise the shell will ignore them.
Expand Down

0 comments on commit 3f7e2a4

Please sign in to comment.