Skip to content

Commit 14060aa

Browse files
authored
Use full file path when file is not inside of basePath (#124)
1 parent b7b3feb commit 14060aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ class AvaJavaScriptTestRunnerRunConfigurationGenerator : AnAction() {
8484
val filePath = currentFile.path
8585
val fileName = Paths.get(filePath).fileName.toString()
8686
val basePath = project.basePath
87-
val relPath = if (basePath == null) fileName else currentFile.path.substring(basePath.length + 1)
87+
val relPath = if (basePath == null || !filePath.startsWith(basePath)) {
88+
filePath
89+
} else {
90+
filePath.substring(basePath.length + 1)
91+
}
8892

8993
val configuration = if (AppSettingsState.instance.selectedCommand) {
9094
this.createNodeJsRunConfiguration(project, fileName, relPath, testName)

0 commit comments

Comments
 (0)