[ci skip] Add a work-in-progress bash-completion shell script.

This commit is contained in:
Username404-59 2021-02-25 22:02:27 +01:00
parent 15439d8b3e
commit 7ccb83dfce
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 11 additions and 1 deletions

View File

@ -40,6 +40,7 @@ add_executable(ybcon src/main.cpp resources/Yerbacon.rc src/parser/MainParse.cpp
# lpkg = linux package, wpkg = windows package
if (UNIX AND NOT MINGW)
include(GNUInstallDirs)
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_lpkg")
set(CPACK_SYSTEM_NAME "Linux-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
@ -54,6 +55,7 @@ if (UNIX AND NOT MINGW)
if (NOT DEFINED CPACK_GENERATOR)
set(CPACK_GENERATOR TGZ;STGZ;RPM;DEB)
endif()
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/bash-completion.sh DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ybcon ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon.sh
PERMISSIONS
OWNER_WRITE

View File

@ -0,0 +1 @@
# Bash autocomplete script for yerbacon

View File

@ -1,3 +1,10 @@
#!/usr/bin/sh
#!/bin/sh
# Post install ybcon script
ln -sf /opt/bin/ybcon.sh /usr/bin/ybcon
bashcompleteLoc="/etc/bash_completion.d"
if [ -d $bashcompleteLoc ]; then
ln -sf /opt/etc/ybcon.d/bash-completion.sh "$bashcompleteLoc/ybcon.sh"
fi