Skip to content

Commit 82caa7c

Browse files
feat: Show-Turtle ( Fixes #257 )
Will not show when not interactive or in a Github workflow or TURTLE_BOT is set
1 parent d7faf70 commit 82caa7c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Commands/Show-Turtle.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ function Show-Turtle
44
.SYNOPSIS
55
Shows a Turtle
66
.DESCRIPTION
7-
Shows a Turtle by opening it with the default file association.
7+
Shows a Turtle by opening it with the default file association.
88
.NOTES
99
It is highly recommended that you show turtles in a browser;
10-
not all drawing programs support the full capabilities of SVG.
10+
not all drawing programs support the full capabilities of SVG.
11+
12+
There are a few circumstances where the Turtle will refuse to show.
13+
14+
* If the session is not interactive
15+
* If $env:GITHUB_WORKFLOW is present
16+
* If $env:TURTLE_BOT is present
1117
#>
1218
[CmdletBinding(PositionalBinding=$false)]
1319
param(
@@ -31,7 +37,7 @@ function Show-Turtle
3137
process {
3238
# If we are not running interactively,
3339
# we obviously do not want to try to show something on the screen.
34-
if (-not [Environment]::UserInteractive -or $env:GITHUB_WORKFLOW) {
40+
if (-not [Environment]::UserInteractive -or $env:GITHUB_WORKFLOW -or $env:TURTLE_BOT) {
3541
# Instead, just pass thru our input.
3642
return $InputObject
3743
}

0 commit comments

Comments
 (0)