We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6b0365 commit 891d066Copy full SHA for 891d066
22/windows-2022/docker-entrypoint.ps1
@@ -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