Skip to content

Commit

Permalink
feat: support ~ in transform file path
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Oct 30, 2023
1 parent 7cb1e56 commit 841d94b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AstxRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AstxParser } from './SearchReplaceView/SearchReplaceViewTypes'
import { AstxExtension } from './extension'
import path from 'path'
import fs from 'fs/promises'
import os from 'os'

export type TransformResultEvent = {
file: vscode.Uri
Expand Down Expand Up @@ -158,6 +159,7 @@ export class AstxRunner extends TypedEmitter<AstxRunnerEvents> {
this.emit('done')
return
}
transformFile = transformFile.trim().replace(/^~/, os.homedir())
if (workspaceFolders.length === 1) {
transformFile = path.resolve(workspaceFolders[0], transformFile)
}
Expand Down

0 comments on commit 841d94b

Please sign in to comment.