Skip to content

Commit 1189c67

Browse files
committed
Validate also for absolute paths for source and directory
1 parent 5cea81c commit 1189c67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/io/vlang/ide/run/VlangRunConfiguration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ open class VlangRunConfiguration(project: Project, factory: ConfigurationFactory
6161
if (!opt.fileName.endsWith(".v") && !opt.fileName.endsWith(".vv") && !opt.fileName.endsWith(".vsh") ) {
6262
throw RuntimeConfigurationError("Source file must be a V file (\".v\", \".vv\", \".vsh\")")
6363
}
64-
if (!File(opt.workingDir, opt.fileName).exists()) {
64+
if (!File(opt.fileName).exists() && !File(opt.workingDir, opt.fileName).exists()) {
6565
throw RuntimeConfigurationError("Source file '${opt.fileName}' does not exist")
6666
}
6767
} else {
6868
if (opt.directory.isBlank()) {
6969
throw RuntimeConfigurationError("Source directory path is empty")
7070
}
71-
if (!File(opt.workingDir, opt.directory).exists()) {
71+
if (!File(opt.directory).exists() && !File(opt.workingDir, opt.directory).exists()) {
7272
throw RuntimeConfigurationError("Source directory '${opt.directory}' does not exist")
7373
}
7474
}

0 commit comments

Comments
 (0)