Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit b208463

Browse files
fix: added validation if stack file exists inside stack (#20)
Signed-off-by: Adroaldo Neto <adroaldo.neto@zup.com.br> Signed-off-by: Adroaldo Neto <adroaldo.neto@zup.com.br>
1 parent 0b56cf0 commit b208463

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main/kotlin/com/stackspot/intellij/services/CreateProjectService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CreateProjectService {
3737
get() {
3838
return if (!Constants.Paths.STK_BIN.exists()) {
3939
ProjectWizardState.NOT_INSTALLED
40-
} else if (ImportedStacks().list().isEmpty()) {
40+
} else if (!ImportedStacks().hasStackFiles()) {
4141
ProjectWizardState.STACKFILES_EMPTY
4242
} else if (!isGitConfigOk()) {
4343
ProjectWizardState.GIT_CONFIG_NOT_OK

src/main/kotlin/com/stackspot/intellij/ui/project_wizard/panels/StackSpotNoStackfilesErrorPanel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class StackSpotNoStackfilesErrorPanel(val parentPanel: StackSpotParentPanel) {
3737
return panel {
3838
row {
3939
text(
40-
"In order to create a StackSpot project, you need to have stacks imported.",
40+
"In order to create a StackSpot project, you need to have stacks imported with <b>stackfiles.</b>",
4141
maxLineLength = 80
4242
)
4343
}

src/main/kotlin/com/stackspot/model/ImportedStacks.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import kotlin.io.path.exists
2323

2424
class ImportedStacks {
2525

26+
fun hasStackFiles() = list().any { it.listStackfiles().isNotEmpty() }
27+
2628
fun list(): List<Stack> {
2729
val stacksDir = getStacksDirPath().toFile()
2830
return stacksDir.walk().filter {

0 commit comments

Comments
 (0)