OSDN Git Service

[update] : Enhanced config
authorhayao <shun819.mail@gmail.com>
Sat, 21 Nov 2020 03:00:26 +0000 (12:00 +0900)
committerhayao <shun819.mail@gmail.com>
Sat, 21 Nov 2020 03:00:26 +0000 (12:00 +0900)
aptpac

diff --git a/aptpac b/aptpac
index d490611..fe014ca 100755 (executable)
--- a/aptpac
+++ b/aptpac
@@ -33,7 +33,7 @@ HELPERS=(
 DEFAULT_PACMAN_COMMAND="/usr/bin/pacman"
 debug=false
 PACMAN_COMMAND="${DEFAULT_PACMAN_COMMAND}"
-
+PACMAN_CONFIG="/etc/pacman.conf"
 
 _msg_error () {
     echo -e "${@}" >&2
@@ -144,7 +144,7 @@ while true; do
             shift 1
             ;;
         -c)
-            ADD_OPTION "--config ${2}"
+            PACMAN_CONFIG="${2}"
             shift 2
             ;;
         --purge)
@@ -253,4 +253,4 @@ if [[ ! "${PACMAN_COMMAND}" = "pacman" ]] && [[ ! "${PACMAN_COMMAND}" = "sudo pa
 fi
 
 # echo "${PACMAN_COMMAND} ${PACMAN_OPTIONS} ${PACKAGE}"
-${PACMAN_COMMAND} ${PACMAN_OPTIONS} ${PACKAGE}
+${PACMAN_COMMAND} ${PACMAN_OPTIONS} --config "${PACMAN_CONFIG}" ${PACKAGE}