Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion misc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ install-data-hook:
-systemctl --no-ask-password daemon-reload

endif
dist_bin_SCRIPTS = cf-support
# cf-support is POSIX sh; Windows gets the PowerShell port and a .cmd wrapper.
# All three are distributed regardless of build host: the dist tarball is
# produced on Unix and consumed by the Windows packaging.
if WINDOWS
bin_SCRIPTS = cf-support.ps1 cf-support.cmd
else
bin_SCRIPTS = cf-support
endif

EXTRA_DIST += cf-support cf-support.ps1 cf-support.cmd

check-local:
@if command -v shellcheck 2>/dev/null; then \
Expand Down
21 changes: 21 additions & 0 deletions misc/cf-support.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@echo off
rem Wrapper for cf-support.ps1.
rem
rem Lets it run from cmd.exe without the default execution policy blocking the
rem unsigned script. Bypass applies to this process only.

setlocal
set "SCRIPT=%~dp0cf-support.ps1"

if not exist "%SCRIPT%" (
echo Could not find "%SCRIPT%"
exit /b 1
)

rem Accept the POSIX spellings; PowerShell only understands -Yes.
set "ARGS=%*"
if /i "%~1"=="--yes" set "ARGS=-Yes"
if /i "%~1"=="-y" set "ARGS=-Yes"

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT%" %ARGS%
exit /b %ERRORLEVEL%
Loading
Loading