refactor: add local keyword

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-04-23 14:50:00 +02:00
parent b03df9811c
commit 3570d58f20
6 changed files with 7 additions and 7 deletions

View File

@@ -269,7 +269,7 @@ function build_fw(){
else
cd "${KLIPPER_DIR}"
status_msg "Initializing firmware build ..."
dep=(build-essential dpkg-dev make)
local dep=(build-essential dpkg-dev make)
dependency_check "${dep[@]}"
make clean && make menuconfig

View File

@@ -114,7 +114,7 @@ function create_moonraker_virtualenv(){
function moonraker_setup(){
local confirm_msg instances=${1}
### checking dependencies
dep=(git wget curl unzip dfu-util virtualenv)
local dep=(git wget curl unzip dfu-util virtualenv)
### additional required dependencies on armbian
dep+=(libjpeg-dev zlib1g-dev)
dependency_check "${dep[@]}"

View File

@@ -248,7 +248,7 @@ function set_nginx_cfg(){
if [ "${SET_NGINX_CFG}" = "true" ]; then
local cfg="${SRCDIR}/kiauh/resources/${1}"
#check for dependencies
dep=(nginx)
local dep=(nginx)
dependency_check "${dep[@]}"
#execute operations
status_msg "Creating Nginx configuration for ${1} ..."

View File

@@ -68,7 +68,7 @@ function octoprint_setup_dialog(){
function octoprint_setup(){
local instances="${1}"
### check and install all dependencies
dep=(
local dep=(
git
wget
python3-pip

View File

@@ -26,8 +26,8 @@ function install_pgc_for_klipper(){
echo -e "${cyan}\n###### On which port should PrettyGCode run? (Default: ${pgc_default_port})${white} "
read -e -p "${cyan}###### Port:${white} " -i "${pgc_default_port}" pgc_custom_port
### check nginx dependency
dep=(nginx)
dependency_check
local dep=(nginx)
dependency_check "${dep[@]}"
### clone repo
[ -d "${PGC_DIR}" ] && rm -rf "${PGC_DIR}"
cd "${HOME}" && git clone "${PGC_FOR_KLIPPER_REPO}"

View File

@@ -577,7 +577,7 @@ function change_hostname(){
function set_hostname(){
local new_hostname=${1} current_date
#check for dependencies
dep=(avahi-daemon)
local dep=(avahi-daemon)
dependency_check "${dep[@]}"
#create host file if missing or create backup of existing one with current date&time