File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const token = require('./token.js');
1111 * @param {Function } callback Callback function that receives a result.
1212 */
1313function getScriptFile ( callback ) {
14+
1415 const settings = ide . config . get ( ) ;
1516 if ( ide . editor . isDirty ( ) && settings . saveFileBeforeExecution ) {
1617 ide . editor . save ( ) ;
@@ -33,7 +34,7 @@ module.exports = getScriptFile;
3334
3435
3536function getScriptFileFromConfig ( ) {
36- let workspacePath = process . env . PWD ;
37+ let workspacePath = path . parse ( process . cwd ( ) ) . root ;
3738
3839 const workspaceFolder = ide . config . getWorkspaceFolder ( ) ;
3940 if ( workspaceFolder ) {
@@ -66,13 +67,14 @@ function getScriptFileFromEditor() {
6667
6768function getScriptFileFromToken ( ) {
6869 let scriptFile = ide . editor . ensereHasPath ( ) ;
70+ const rootDir = path . parse ( scriptFile ) . root ;
6971 let scriptFolder = path . dirname ( scriptFile ) ;
70-
72+
7173 let tokenPath = token . getPath ( ) ;
7274 tokenPath = file . untildify ( tokenPath ) ;
7375
7476 let targetFile ;
75- while ( scriptFolder !== process . env . PWD ) {
77+ while ( scriptFolder !== rootDir ) {
7678 targetFile = path . join ( scriptFolder , tokenPath ) ;
7779 targetFile = path . resolve ( targetFile ) ;
7880
You can’t perform that action at this time.
0 commit comments