sequencer - don't create any config if only profiles should be listed

This commit is contained in:
2022-04-21 23:22:21 +02:00
parent f20043fd61
commit 25962beb02

View File

@@ -487,7 +487,7 @@ listProfiles() {
return 1 return 1
fi fi
[[ "$1" == "-q" ]] && return 0 [[ "$1" == "-q" ]] && return 0
for file in $(ls "$SEQ_CONFIG_HOME"); do for file in $(ls "$SEQ_CONFIG_HOME" 2>/dev/null); do
[[ ${file%.*} =~ ^${1:-".*"} ]] && profiles+=(${file%.*}) [[ ${file%.*} =~ ^${1:-".*"} ]] && profiles+=(${file%.*})
done done
printf '%s\n' "${profiles[*]}" printf '%s\n' "${profiles[*]}"
@@ -538,10 +538,10 @@ initSeqConfig() {
local configDir="$(dirname $configLoc)" local configDir="$(dirname $configLoc)"
local configTemplate="$2" local configTemplate="$2"
# Create config subdir in users home # Don't create anything if only profiles should be listed
if [ ! -e "$configDir/" ] ; then if [ -n "${SEQ_PROFILE_LIST}" ] ; then
echoseq -n " [I] Creating $(realpath $configDir)..." SEQ_CONFIG_HOME="$configDir"
exe install -m 700 -d "$configDir" && echoseq "Ok" || echoseq "Nok" return 0
fi fi
SEQ_CONFIG_HOME="$configDir" SEQ_CONFIG_HOME="$configDir"
@@ -565,6 +565,12 @@ initSeqConfig() {
;; ;;
esac esac
fi fi
# Create config subdir in users home
if [ ! -e "$configDir/" ] ; then
echoseq -n " [I] Creating $(realpath $configDir)..."
exe install -m 700 -d "$configDir" && echoseq "Ok" || echoseq "Nok"
fi
# Config does not exist, check for template # Config does not exist, check for template
if [ -s "$configTemplate" ] ; then if [ -s "$configTemplate" ] ; then