From 06834fddff66f8af7fc6c4c82f16e9a0bfac6071 Mon Sep 17 00:00:00 2001 From: "Tessa L. H. Lovelace" Date: Sun, 30 Jun 2019 06:49:16 -0700 Subject: [PATCH] Fix sourcing the wrong file location, remove conditional example writeout. --- CMakeLists.txt | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfbd8f2..938290e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,21 +123,12 @@ install(FILES etc/laminarc-completion.zsh DESTINATION ${ZSH_COMPLETIONS_DIR} REN install(TARGETS laminard laminarc RUNTIME DESTINATION usr/bin) install(FILES etc/laminar.service DESTINATION ${SYSTEMD_UNITDIR}) -# An initial attempt at solving https://github.com/ohwgiles/laminar/issues/92 +# Don't overwrite the config file if it already exists at the target location +# @todo - migration/override script if the defaults change or the options get pruned? if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}etc/laminar.conf") install( - FILES ${CMAKE_INSTALL_PREFIX}etc/laminar.conf - DESTINATION etc - ) -else(NOT EXISTS "${CMAKE_INSTALL_PREFIX}etc/laminar.conf") - # hardcoded values are examples of technical debt, and in an ideal world, are eliminated. - MESSAGE("-- A ${CMAKE_INSTALL_PREFIX}etc/laminar.conf file exists, will create ${CMAKE_INSTALL_PREFIX}etc/laminar.conf.example instead of overwriting.") - # This also displays at config time, rather than install time. - # In an ideal world, the user gets offered the option to overwrite, compare, or keep/copy the file - install( - FILES ${CMAKE_INSTALL_PREFIX}etc/laminar.conf - DESTINATION etc - RENAME "laminar.conf.example" + FILES etc/laminar.conf + DESTINATION ${CMAKE_INSTALL_PREFIX}etc ) endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}etc/laminar.conf")