refactor: add local keyword
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -269,7 +269,7 @@ function build_fw(){
|
|||||||
else
|
else
|
||||||
cd "${KLIPPER_DIR}"
|
cd "${KLIPPER_DIR}"
|
||||||
status_msg "Initializing firmware build ..."
|
status_msg "Initializing firmware build ..."
|
||||||
dep=(build-essential dpkg-dev make)
|
local dep=(build-essential dpkg-dev make)
|
||||||
dependency_check "${dep[@]}"
|
dependency_check "${dep[@]}"
|
||||||
|
|
||||||
make clean && make menuconfig
|
make clean && make menuconfig
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ function create_moonraker_virtualenv(){
|
|||||||
function moonraker_setup(){
|
function moonraker_setup(){
|
||||||
local confirm_msg instances=${1}
|
local confirm_msg instances=${1}
|
||||||
### checking dependencies
|
### checking dependencies
|
||||||
dep=(git wget curl unzip dfu-util virtualenv)
|
local dep=(git wget curl unzip dfu-util virtualenv)
|
||||||
### additional required dependencies on armbian
|
### additional required dependencies on armbian
|
||||||
dep+=(libjpeg-dev zlib1g-dev)
|
dep+=(libjpeg-dev zlib1g-dev)
|
||||||
dependency_check "${dep[@]}"
|
dependency_check "${dep[@]}"
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ function set_nginx_cfg(){
|
|||||||
if [ "${SET_NGINX_CFG}" = "true" ]; then
|
if [ "${SET_NGINX_CFG}" = "true" ]; then
|
||||||
local cfg="${SRCDIR}/kiauh/resources/${1}"
|
local cfg="${SRCDIR}/kiauh/resources/${1}"
|
||||||
#check for dependencies
|
#check for dependencies
|
||||||
dep=(nginx)
|
local dep=(nginx)
|
||||||
dependency_check "${dep[@]}"
|
dependency_check "${dep[@]}"
|
||||||
#execute operations
|
#execute operations
|
||||||
status_msg "Creating Nginx configuration for ${1} ..."
|
status_msg "Creating Nginx configuration for ${1} ..."
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function octoprint_setup_dialog(){
|
|||||||
function octoprint_setup(){
|
function octoprint_setup(){
|
||||||
local instances="${1}"
|
local instances="${1}"
|
||||||
### check and install all dependencies
|
### check and install all dependencies
|
||||||
dep=(
|
local dep=(
|
||||||
git
|
git
|
||||||
wget
|
wget
|
||||||
python3-pip
|
python3-pip
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ function install_pgc_for_klipper(){
|
|||||||
echo -e "${cyan}\n###### On which port should PrettyGCode run? (Default: ${pgc_default_port})${white} "
|
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
|
read -e -p "${cyan}###### Port:${white} " -i "${pgc_default_port}" pgc_custom_port
|
||||||
### check nginx dependency
|
### check nginx dependency
|
||||||
dep=(nginx)
|
local dep=(nginx)
|
||||||
dependency_check
|
dependency_check "${dep[@]}"
|
||||||
### clone repo
|
### clone repo
|
||||||
[ -d "${PGC_DIR}" ] && rm -rf "${PGC_DIR}"
|
[ -d "${PGC_DIR}" ] && rm -rf "${PGC_DIR}"
|
||||||
cd "${HOME}" && git clone "${PGC_FOR_KLIPPER_REPO}"
|
cd "${HOME}" && git clone "${PGC_FOR_KLIPPER_REPO}"
|
||||||
|
|||||||
@@ -577,7 +577,7 @@ function change_hostname(){
|
|||||||
function set_hostname(){
|
function set_hostname(){
|
||||||
local new_hostname=${1} current_date
|
local new_hostname=${1} current_date
|
||||||
#check for dependencies
|
#check for dependencies
|
||||||
dep=(avahi-daemon)
|
local dep=(avahi-daemon)
|
||||||
dependency_check "${dep[@]}"
|
dependency_check "${dep[@]}"
|
||||||
|
|
||||||
#create host file if missing or create backup of existing one with current date&time
|
#create host file if missing or create backup of existing one with current date&time
|
||||||
|
|||||||
Reference in New Issue
Block a user