Skip to content

Commit

Permalink
make bash completion script install optional
Browse files Browse the repository at this point in the history
  • Loading branch information
calccrypto committed Nov 2, 2023
1 parent 5e03d14 commit 6deaf60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mkdir build
cd build
cmake ..
make
sudo make install
(sudo) make install

# create a GUFI tree
gufi_dir2index <src_dir> <index_dir>
Expand Down
4 changes: 4 additions & 0 deletions docs/latex/sections/build.tex
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ \subsubsection{System Paths}
& packages if installing GUFI via package. If installing GUFI \\
& with \texttt{make install}, point to a convenient location. \\
\hline
\texttt{BASH\_COMPLETION=<On|Off>} & Whether or not to install bash completion script to \\
& \texttt{/etc/bash\_completion.d}. \\
& Useful when running \texttt{make install} without root.\\
\hline
\end{tabularx}
\end{table}

Expand Down
7 changes: 5 additions & 2 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ foreach(LIB ${LIBRARIES})
endforeach()

# bash completions for the tools so paths can be tab completed
configure_file(bash_completion bash_completion @ONLY)
install(FILES bash_completion DESTINATION "/etc/bash_completion.d" COMPONENT Server RENAME gufi)
option(BASH_COMPLETION "Whether or not to install bash completion script" On)
if (BASH_COMPLETION)
configure_file(bash_completion bash_completion @ONLY)
install(FILES bash_completion DESTINATION "/etc/bash_completion.d" COMPONENT Server RENAME gufi)
endif()

# CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION needs to be sent all the way to the root scope
# in order to not add /etc/bash_completion.d into the RPMs
Expand Down

0 comments on commit 6deaf60

Please sign in to comment.