• R/O
  • HTTP
  • SSH
  • HTTPS

dmc: Commit

GitHubのミラーです
https://github.com/FascodeNet/dmc


Commit MetaInfo

Revisão2b6b3b906c7e9109b82e11307e9e0c0714062e85 (tree)
Hora2021-05-09 22:45:56
Autorhayao <hayao@fasc...>
Commiterhayao

Mensagem de Log

[fix] : Fixed command check

Mudança Sumário

Diff

--- a/dmc
+++ b/dmc
@@ -164,27 +164,17 @@ check_bool(){
164164 fi
165165 }
166166
167-# コマンドラッパー
168-wrapper(){
169- local _command="${1}"
170- shift 1
171- if which "${_command}" >/dev/null 2>&1; then
172- $(which "${_command}") "${@}"
173- else
174- msg_error "${_command} was not found"
175- exit 1
176- fi
177-}
178-
179-# crudini ラッパー
180-crudini(){
181- wrapper crudini "${@}"
167+# インストールされていないコマンドを確認
168+check_tools(){
169+ local _command
170+ for _command in "${@}"; do
171+ if ! which "${_command}" >/dev/null 2>&1; then
172+ msg_error "${_command} was not found"
173+ exit 1
174+ fi
175+ done
182176 }
183177
184-# jq ラッパー
185-jq(){
186- wrapper jq "${@}"
187-}
188178
189179 # 指定されたコマンドが現在のモードで実行可能かどうかを判定する
190180 check_command_dm(){
@@ -1749,6 +1739,9 @@ if [[ "${NO_CHECK_TARGET}" = false ]]; then
17491739 check_main_binary
17501740 fi
17511741
1742+# 依存コマンドの確認
1743+ check_tools "jq" "crudini"
1744+
17521745 # コマンドとモードに応じて関数を実行する
17531746 case "${COMMAND}" in
17541747 "accessibility")
Show on old repository browser