Skip to content

Commit 891d066

Browse files
committed
Added entrypoint for windows 22
1 parent d6b0365 commit 891d066

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

22/windows-2022/docker-entrypoint.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ensure script stops on any error
2+
$ErrorActionPreference = 'Stop'
3+
4+
# Check if the first argument:
5+
# 1. Contains a "-"
6+
# 2. Is NOT a recognized command
7+
# 3. Is a file that's NOT executable
8+
if (($args[0] -like '*-') -or
9+
(!(Get-Command $args[0] -ErrorAction SilentlyContinue)) -or
10+
(((Test-Path $args[0] -PathType Leaf)) -and -not ((Get-Item $args[0]).Attributes -band 'ReadOnly'))) {
11+
# Prepend 'node' to the argument list
12+
$args = @('node') + $args
13+
}
14+
15+
# Execute the (potentially modified) command
16+
& $args[0] $args[1..($args.Length-1)]

0 commit comments

Comments
 (0)