Skip to content

Commit

Permalink
Retro-fit ahead of migration to ResolveProgram
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Feb 28, 2024
1 parent 71ca4a8 commit 7b6da2b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions internal/document/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,20 @@ func (b *CodeBlock) Interpreter() string {
}

func (b *CodeBlock) PromptEnv() bool {
val, err := strconv.ParseBool(b.Attributes()["promptEnv"])
if err != nil {
val, ok := b.Attributes()["promptEnv"]
if !ok {
return true
}

return val
// todo(sebastian): integration with ResolveProgram
switch strings.ToLower(val) {
case "false", "no", "0":
return false
default:
// use default return
}

return true
}

func (b *CodeBlock) ExcludeFromRunAll() bool {
Expand Down

0 comments on commit 7b6da2b

Please sign in to comment.