@@ -3,7 +3,7 @@ const vscode = require('vscode')
33const path = require ( 'path' )
44const findFiles = require ( './findFiles' )
55const fs = require ( 'fs' )
6- const { getProperties, getInput, getQuickPick } = require ( './util' )
6+ const { getProperties, getInput, getQuickPick, replaceAll } = require ( './util' )
77const { UIString } = require ( './constant' )
88// fetch setting value from vscode's settings
99// See package.json's contributes's configuration
@@ -106,13 +106,16 @@ const activate = (context) => {
106106 const currentlyOpenTabfilePath =
107107 vscode . window . activeTextEditor . document . fileName
108108 const currentlyOpenTabfileName = path . basename ( currentlyOpenTabfilePath )
109- const pathSep = process . platform === 'win32' ? `${ path . sep } ${ path . sep } ` : `${ path . sep } `
110- const codeReplacerPath = `${ __dirname } ${ pathSep } node_modules${ pathSep } code-replacer${ pathSep } dist`
111- const binPath = path . resolve ( `${ codeReplacerPath } ${ pathSep } index.js` )
112- const envPath = path . resolve ( `${ codeReplacerPath } ${ pathSep } ${ '.env' } ` )
113- const usageLogPath = path . resolve (
114- `${ codeReplacerPath } ${ pathSep } usageLog.json`
115- )
109+ const pathSep =
110+ process . platform === 'win32' ? path . sep + path . sep : path . sep
111+ const dirName =
112+ process . platform === 'win32'
113+ ? replaceAll ( __dirname , '\\' , '\\\\' )
114+ : __dirname
115+ const codeReplacerPath = `${ dirName } ${ pathSep } node_modules${ pathSep } code-replacer${ pathSep } dist`
116+ const binPath = `${ codeReplacerPath } ${ pathSep } index.js`
117+ const envPath = `${ codeReplacerPath } ${ pathSep } ${ '.env' } `
118+ const usageLogPath = `${ codeReplacerPath } ${ pathSep } usageLog.json`
116119 const workspaceName = vscode . workspace . name
117120 const workspacePath = vscode . workspace . rootPath
118121 const csvFiles = await findFiles ( {
0 commit comments