Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit to invoke ign command in Windows #73

Merged
merged 1 commit into from
Nov 29, 2021
Merged
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: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ configure_file(ign.in ${ign_script_configured})
file(GENERATE OUTPUT ${ign_script_generated} INPUT ${ign_script_configured})
install (PROGRAMS ${ign_script_generated} DESTINATION ${BIN_INSTALL_DIR})

if(WIN32)
# On Windows also install the executable as ign
# to permit to invoke ign via Git Bash
# see https://github.com/ignitionrobotics/ign-tools/issues/70
install (PROGRAMS ${ign_script_generated} DESTINATION ${BIN_INSTALL_DIR} RENAME ign)

# On Windows also install the ign.bat wrapper script to permit to
# invoke ign via Command Prompt or Powershell
install (PROGRAMS ign.bat DESTINATION ${BIN_INSTALL_DIR})
endif()

#===============================================================================
# BEGIN TEST ign command
# Generate the ruby script for internal testing.
Expand Down
6 changes: 6 additions & 0 deletions src/ign.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
REM %~dp0 is the directory in which this bat script is, see
REM https://stackoverflow.com/questions/112055/what-does-d0-mean-in-a-windows-batch-file
REM %* redirects the arguments to the output, see
REM https://serverfault.com/questions/22443/do-windows-batch-files-have-a-construction/22541#22541
ruby %~dp0\ign %*