mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
config: Allow setting USERNAME/HOSTNAME from the environment
Allowing this to be controlled externally improves reproducibility, as well as provides a more useful address to report for "Compiled by". For example, I intend to set it to the packaging list when building the Debian package. Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
parent
1984072822
commit
9b0b281b75
@ -142,12 +142,16 @@ configure_file (
|
||||
find_program(WHOAMI_PROG whoami)
|
||||
find_program(HOSTNAME_PROG hostname)
|
||||
|
||||
if (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
|
||||
if (DEFINED ENV{USERNAME})
|
||||
set(USERNAME $ENV{USERNAME})
|
||||
elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
|
||||
execute_process(COMMAND ${WHOAMI_PROG}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE USERNAME)
|
||||
endif()
|
||||
if (EXISTS ${HOSTNAME_PROG})
|
||||
if (DEFINED ENV{HOSTNAME})
|
||||
set(HOSTNAME $ENV{HOSTNAME})
|
||||
elseif (EXISTS ${HOSTNAME_PROG})
|
||||
execute_process(COMMAND ${HOSTNAME_PROG}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE HOSTNAME)
|
||||
|
Loading…
Reference in New Issue
Block a user