-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(scripts): 🚨 Fix shell script linting
Fix shell script linting
- Loading branch information
Showing
8 changed files
with
81 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (C) 2023 Chris Laprade | ||
# | ||
# | ||
# This file is part of zippy_config. | ||
# | ||
# | ||
# zippy_config is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# | ||
# zippy_config is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with zippy_config. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
# Copyright (C) 2023 Chris Laprade ([email protected]) | ||
# | ||
# | ||
# This file is part of zippy_print. | ||
# | ||
# | ||
# zippy_print is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# | ||
# zippy_print is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with zippy_print. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#!/bin/bash | ||
|
||
# Help function | ||
function show_help { | ||
echo "Usage: $0 [directory_path]" | ||
|
@@ -58,7 +58,7 @@ py_count=$(find "$1" -type f -name "*.py" | wc -l) # Count the number of .py fil | |
total_count=$((sh_count + py_count)) # Add the counts together to get the total count | ||
|
||
# Make every .sh and .py file executable | ||
find "$1" -type f \( -name "*.sh" -o -name "*.py" \) -print0 | while read -d $'\0' file # Find all .sh and .py files and loop through them | ||
find "$1" -type f \( -name "*.sh" -o -name "*.py" \) -print0 | while read -rd $'\0' file # Find all .sh and .py files and loop through them | ||
do | ||
if [[ ! -x $file ]]; then # Check if the file is not executable | ||
chmod -v +x "$file" # Make the file executable and print a message | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
export $(grep -v '^#' ~/.gh_token | xargs -0) | ||
export "$(grep -v '^#' ~/.gh_token | xargs -0)" | ||
|
||
##################################################################### | ||
### Please set the paths accordingly. In case you don't have all ### | ||
|
@@ -29,45 +29,45 @@ mainsail_folder=~/mainsail | |
################ !!! DO NOT EDIT BELOW THIS LINE !!! ################ | ||
##################################################################### | ||
grab_version(){ | ||
if [ ! -z "$klipper_folder" ]; then | ||
echo -n "Getting klipper version=" | ||
cd "$klipper_folder" | ||
klipper_commit=$(git rev-parse --short=7 HEAD) | ||
m1="Klipper on commit: $klipper_commit" | ||
echo $klipper_commit | ||
cd .. | ||
fi | ||
if [ ! -z "$moonraker_folder" ]; then | ||
echo -n "Getting moonraker version=" | ||
cd "$moonraker_folder" | ||
moonraker_commit=$(git rev-parse --short=7 HEAD) | ||
m2="Moonraker on commit: $moonraker_commit" | ||
echo $moonraker_commit | ||
cd .. | ||
fi | ||
if [ ! -z "$mainsail_folder" ]; then | ||
echo -n "Getting mainsail version=" | ||
mainsail_ver=$(head -n 1 $mainsail_folder/.version) | ||
m3="Mainsail version: $mainsail_ver" | ||
echo $mainsail_ver | ||
fi | ||
if [ ! -z "$fluidd_folder" ]; then | ||
echo -n "Getting fluidd version=" | ||
fluidd_ver=$(head -n 1 $fluidd_folder/.version) | ||
m4="Fluidd version: $fluidd_ver" | ||
echo $fluidd_ver | ||
fi | ||
if [ -n "$klipper_folder" ]; then | ||
echo -n "Getting klipper version=" | ||
cd "$klipper_folder" || exit | ||
klipper_commit=$(git rev-parse --short=7 HEAD) | ||
m1="Klipper on commit: $klipper_commit" | ||
echo "$klipper_commit" | ||
cd .. | ||
fi | ||
if [ -n "$moonraker_folder" ]; then | ||
echo -n "Getting moonraker version=" | ||
cd "$moonraker_folder" || exit | ||
moonraker_commit=$(git rev-parse --short=7 HEAD) | ||
m2="Moonraker on commit: $moonraker_commit" | ||
echo "$moonraker_commit" | ||
cd .. | ||
fi | ||
if [ -n "$mainsail_folder" ]; then | ||
echo -n "Getting mainsail version=" | ||
mainsail_ver=$(head -n 1 $mainsail_folder/.version) | ||
m3="Mainsail version: $mainsail_ver" | ||
echo "$mainsail_ver" | ||
fi | ||
if [ -n "$fluidd_folder" ]; then | ||
echo -n "Getting fluidd version=" | ||
fluidd_ver=$(head -n 1 "$fluidd_folder"/.version) | ||
m4="Fluidd version: $fluidd_ver" | ||
echo "$fluidd_ver" | ||
fi | ||
} | ||
|
||
push_config(){ | ||
cd $config_folder | ||
echo Pushing updates | ||
git pull -v | ||
git add . -v | ||
current_date=$(date +"%Y-%m-%d %T") | ||
git commit -m "Backup triggered on $current_date" -m "$m1" -m "$m2" -m "$m3" -m "$m4" | ||
# git push "https://rootiest:[email protected]/rootiest/zippy-klipper_config.git" | ||
git push "[email protected]:rootiest/zippy-klipper_config.git" | ||
cd $config_folder || exit | ||
echo Pushing updates | ||
git pull -v | ||
git add . -v | ||
current_date=$(date +"%Y-%m-%d %T") | ||
git commit -m "Backup triggered on $current_date" -m "$m1" -m "$m2" -m "$m3" -m "$m4" | ||
# git push "https://rootiest:[email protected]/rootiest/zippy-klipper_config.git" | ||
git push "[email protected]:rootiest/zippy-klipper_config.git" | ||
} | ||
|
||
grab_version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
#!/bin/bash | ||
# Copyright (C) 2023 Chris Laprade ([email protected]) | ||
# | ||
# | ||
# This file is part of config. | ||
# | ||
# | ||
# config is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# | ||
# config is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with config. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#!/bin/bash | ||
|
||
# Check if both the source and output filename arguments are provided | ||
if [ $# -lt 2 ] | ||
then | ||
then | ||
echo "Error: Two filenames are required." | ||
exit 1 | ||
fi | ||
|
||
# Check if the source file exists | ||
if [ ! -f $1 ] | ||
then | ||
if [ ! -f "$1" ] | ||
then | ||
echo "Error: Source file not found." | ||
exit 1 | ||
fi | ||
|
@@ -42,17 +41,17 @@ output_extension="${source_extension}" | |
output_basename=$(basename -- "$2") | ||
output_basename="${output_basename%.*}" | ||
if [ "${output_filename}" = "${output_basename}" ] | ||
then | ||
then | ||
output_filename="${output_filename}.${output_extension}" | ||
fi | ||
|
||
# Invert the file | ||
tac $1 > $output_filename | ||
tac "$1" > "$output_filename" | ||
|
||
# Confirm successful inversion | ||
if [ $? -eq 0 ] | ||
then | ||
then | ||
echo "File successfully inverted as $output_filename." | ||
else | ||
else | ||
echo "Error: Unable to invert file." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/bash | ||
# This script is used to patch the stock Klipper install with the testing KAMP fork | ||
cd ~ | ||
cd ~ || exit | ||
git clone -b for/master/adaptive_bed_mesh https://github.com/voidtrance/klipper.git kamp-klipper | ||
cd kamp-klipper | ||
cd kamp-klipper || exit | ||
mkdir ~/stock_klipper_files | ||
mv ~/klipper/klippy/extras/bed_mesh.py ~/stock_klipper_files/bed_mesh.py | ||
cd ~/kamp_klipper | ||
cd ~/kamp_klipper || exit | ||
ln -sr klippy/extras/bed_mesh.py ~/klipper/klippy/extras/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters