-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:; exec "$@" # | ||
:; exit $? # | ||
|
||
@echo off | ||
%HELM_PLUGIN_DIR%\wrapper\sh.sh %* | ||
exit /b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
@setlocal enableextensions enabledelayedexpansion | ||
@echo off | ||
|
||
:: If HELM_SECRETS_WINDOWS_SHELL is provided, use it. | ||
if "%HELM_SECRETS_WINDOWS_SHELL%"!="" GOTO :ENVSH | ||
|
||
:: check for cygwin installation or git for windows is inside %PATH% | ||
sh -c exit >nul 2>&1 | ||
|
||
IF %ERRORLEVEL% EQU 0 GOTO :SH | ||
|
||
:: check for git-bash | ||
C:\Program^ Files\Git\bin\bash.exe -c exit >nul 2>&1 | ||
|
||
IF %ERRORLEVEL% EQU 0 GOTO :GITBASH | ||
|
||
:: check for git-bash (32-bit) | ||
C:\Program^ Files^ (x86)\Git\bin\bash.exe -c exit >nul 2>&1 | ||
|
||
IF %ERRORLEVEL% EQU 0 GOTO :GITBASH32 | ||
|
||
:: check for wsl | ||
wsl sh -c exit >nul 2>&1 | ||
|
||
IF %ERRORLEVEL% EQU 0 GOTO :WSL | ||
|
||
GOTO :NOSHELL | ||
|
||
:ENVSH | ||
%HELM_SECRETS_WINDOWS_SHELL% "%*" | ||
GOTO :EOF | ||
|
||
:SH | ||
sh "'%HELM_PLUGIN_DIR%\scripts\run.sh' %*" | ||
GOTO :EOF | ||
|
||
:GITBASH | ||
C:\Program^ Files\Git\bin\bash.exe "%*" | ||
GOTO :EOF | ||
|
||
:GITBASH32 | ||
C:\Program^ Files^ (x86)\Git\bin\bash.exe "%*" | ||
GOTO :EOF | ||
|
||
:WSL | ||
:: Use WSL, but convert all paths (script + arguments) to wsl paths | ||
SET ARGS= | ||
|
||
:: Loop through all parameters - https://stackoverflow.com/a/34019557/8087167 | ||
:LOOP | ||
if "%1"=="" goto ENDLOOP | ||
|
||
:: CMD output to variable - https://stackoverflow.com/a/6362922/8087167 | ||
FOR /F "tokens=* USEBACKQ" %%F IN (`wsl wslpath "%1"`) DO ( | ||
SET WSLPATH=%%F | ||
) | ||
SET ARGS=%ARGS% %WSLPATH% | ||
|
||
shift | ||
goto LOOP | ||
:ENDLOOP | ||
|
||
wsl bash -x -c "%ARGS%" | ||
GOTO :EOF | ||
|
||
:NOSHELL | ||
:: If no *nix shell found, raise an error. | ||
echo helm-secrets needs a unix shell. Please install WSL, cygwin or Git for Windows. | ||
exit /B 1 | ||
GOTO :EOF |