alis
alis copied to clipboard
Should the same variables be in multiple .conf files?
I noticed that some variables appear in more that one .conf file. I thought the alis-commons.conf would be the location to place variables common to more than one of the .sh scripts.
I noticed this when setting USER_NAME and then found it in two .conf files, so I searched all of the .conf files for the same variable settings and found this:
% grep -f <(grep -h '^[A-Z]' {alis,alis-commons,alis-packages}.conf | sort | cut -f 1 -d= | uniq -c | grep -v ' 1 ' | awk '{print "^"$NF"="}') {alis,alis-commons,alis-packages}.conf
alis.conf:LOG="false"
alis.conf:AUR_PACKAGE="paru-bin !yay-bin !paru !yay !aurman" # (single)
alis.conf:USER_NAME="picodotdev"
alis.conf:USER_PASSWORD="ask"
alis.conf:PACKAGES_PIPEWIRE="false"
alis.conf:SYSTEMD_UNITS=""
alis-commons.conf:AUR_PACKAGE="paru-bin"
alis-commons.conf:LOG="false"
alis-commons.conf:USER_NAME="picodotdev"
alis-commons.conf:USER_PASSWORD="ask"
alis-commons.conf:PACKAGES_PIPEWIRE="false"
alis-packages.conf:LOG="false"
alis-packages.conf:SYSTEMD_UNITS="!ufw.service !bluetooth.service !docker.service"
If I include alis-recovery.conf in both greps above (or change the file list to *.conf), the list is even longer.
The variables in files alis.conf and alis-packages.conf are the files the user should edit and know. alis-commons.conf is a internal script file the user should not be awared of.
I would need to review if some of those alis-commons.conf could be deduped but is not an important thing for me.