mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
toolrunner should which tool before invoking (#220)
This commit is contained in:
12
packages/exec/__tests__/scripts/print-args-cmd.cmd
Normal file
12
packages/exec/__tests__/scripts/print-args-cmd.cmd
Normal file
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
setlocal
|
||||
set index=0
|
||||
|
||||
:check_arg
|
||||
set arg=%1
|
||||
if not defined arg goto :eof
|
||||
set "arg=%arg:"=<quote>%"
|
||||
echo args[%index%]: "%arg%"
|
||||
set /a index=%index%+1
|
||||
shift
|
||||
goto check_arg
|
||||
11
packages/exec/__tests__/scripts/print-args-sh.sh
Executable file
11
packages/exec/__tests__/scripts/print-args-sh.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# store arguments in a special array
|
||||
args=("$@")
|
||||
# get number of elements
|
||||
ELEMENTS=${#args[@]}
|
||||
|
||||
# echo each element
|
||||
for (( i=0;i<$ELEMENTS;i++)); do
|
||||
echo "args[$i]: \"${args[${i}]}\""
|
||||
done
|
||||
Reference in New Issue
Block a user