mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-12 17:20:40 +01:00
19 lines
576 B
Bash
19 lines
576 B
Bash
|
#!/usr/bin/env bash
|
||
|
# -----------------------------------------------------------------------------
|
||
|
# bat-extras | Copyright (C) 2021 eth-p | MIT License
|
||
|
#
|
||
|
# Repository: https://github.com/eth-p/bat-extras
|
||
|
# Issues: https://github.com/eth-p/bat-extras/issues
|
||
|
# -----------------------------------------------------------------------------
|
||
|
|
||
|
# Gets a configuration directory for a command-line program.
|
||
|
# Arguments:
|
||
|
# 1 -- The program name.
|
||
|
config_dir() {
|
||
|
if [[ -n "${XDG_CONFIG_HOME+x}" ]]; then
|
||
|
echo "${XDG_CONFIG_HOME}/$1"
|
||
|
else
|
||
|
echo "${HOME}/.config/$1"
|
||
|
fi
|
||
|
}
|