Skip to content

Commit

Permalink
Fix error on windows while trying to import nightwatch conf file. (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 authored Feb 23, 2024
1 parent 413ad86 commit 07576f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/NightwatchExt/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class NightwatchExt {
if (
(document && editor.document === document) ||
vscode.workspace.getWorkspaceFolder(editor.document.uri) ===
this.extContext.workspace
this.extContext.workspace
) {
this.triggerUpdateActiveEditor(editor);
}
Expand Down Expand Up @@ -392,9 +392,9 @@ export class NightwatchExt {
.findFiles('**/*nightwatch*.conf.{js,ts,cjs}', undefined, 1)
.then(async (res) => {
delete __non_webpack_require__.cache[
__non_webpack_require__.resolve(res[0].path)
__non_webpack_require__.resolve(res[0].fsPath)
];
const nwConfig = require(/* webpackIgnore: true */ res[0].path);
const nwConfig = require(/* webpackIgnore: true */ res[0].fsPath);
const workspaceState = this.context.workspaceState;
workspaceState.update('nwConfig', nwConfig);
this.environmentsPanel._addNwEnvironments();
Expand Down
6 changes: 3 additions & 3 deletions src/extensionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export class ExtensionManager {
.findFiles('**/*nightwatch*.conf.{js,ts,cjs}', undefined, 1)
.then((res) => {
delete __non_webpack_require__.cache[
__non_webpack_require__.resolve(res[0].path)
__non_webpack_require__.resolve(res[0].fsPath)
];
const nwConfig = require(/* webpackIgnore: true */ res[0].path);
const nwConfig = require(/* webpackIgnore: true */ res[0].fsPath);
const workspaceState = this.context.workspaceState;
workspaceState.update('nwConfig', nwConfig);
});
Expand Down Expand Up @@ -125,7 +125,7 @@ export class ExtensionManager {
const vscode = this._vscode;
const workspace =
vscode.workspace.workspaceFolders &&
vscode.workspace.workspaceFolders.length <= 1
vscode.workspace.workspaceFolders.length <= 1
? vscode.workspace.workspaceFolders[0]
: await vscode.window.showWorkspaceFolderPick();

Expand Down

0 comments on commit 07576f3

Please sign in to comment.