Skip to content

Commit 630104b

Browse files
authored
Fix for windows paths (#1)
* Fix for windows paths Signed-off-by: Derek Ho <[email protected]> * Dont install plugin on windows if empty Signed-off-by: Derek Ho <[email protected]> --------- Signed-off-by: Derek Ho <[email protected]>
1 parent fdbe91e commit 630104b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

action.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,15 @@ runs:
7979
shell: bash
8080

8181
- name: Install plugin(s) into OpenSearch for Windows
82-
if: ${{ runner.os == 'Windows'}}
82+
if: ${{ runner.os == 'Windows' && inputs.plugins != '' }}
8383
run: |
84-
chmod +x ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/bin/opensearch-plugin.bat
85-
plugins="${{ inputs.plugins }}"
86-
if [ -n "$plugins" ]; then
87-
echo "$plugins" | tr ',' '\n' | while read -r plugin; do
88-
/bin/bash -c "yes | ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/bin/opensearch-plugin.bat install ${plugin}"
89-
done
90-
fi
91-
shell: bash
84+
$pluginNames = "${{ inputs.plugins }}" -split ','
85+
if ($pluginNames.Length -gt 0) {
86+
foreach ($plugin in $pluginNames) {
87+
'y' | .\opensearch-${{ inputs.opensearch-version }}-SNAPSHOT\bin\opensearch-plugin.bat install ${plugin}
88+
}
89+
}
90+
shell: pwsh
9291

9392
- name: Replace security configuration file if applicable
9493
if: ${{ inputs.security_config_file != '' }}

0 commit comments

Comments
 (0)