move common functions to bin/common

parent 0858350d
......@@ -19,25 +19,8 @@ if [ -z "$PROFILESDIR" ]; then
PROFILESDIR="/home/$USER/Projects/ximper-builder/mkimage-profiles"
fi
print_error() {
printf "\033[1;31m%s\033[0m\n" "$1"
}
print_green() {
printf "\033[1;32m%s\033[0m\n" "$1"
}
print_yellow() {
printf "\033[1;33m%s\033[0m\n" "$1"
}
print_blue() {
printf "\033[1;34m%s\033[0m\n" "$1"
}
print_red() {
printf "\033[1;31m%s\033[0m\n" "$1"
}
# базовые функции
. $(dirname $0)/common
print_paths() {
echo "____________________"
......@@ -155,7 +138,7 @@ eval set -- "$OPTS"
while true; do
case "$1" in
-h|--help)
printf "Использование: ./distrobuild.sh [опции] [версия дистрибутива]\n\n"
printf "Использование: $0 [опции] [версия дистрибутива]\n\n"
printf "Опции:\n"
printf " --nvidia Собирает дистрибутив с драйверами nvidia\n"
printf " --debug Включает режим отладки\n"
......
#!/bin/bash
echo "Cleaning...."
# базовые функции
. $(dirname $0)/common
print_blue "Cleaning...."
[ -d "$PROFILESDIR/build" ] && \
pushd $PROFILESDIR \
&& make clean \
&& rm -rf $TMP/mkimage-profiles.build.* \
&& rm -rf ./build && popd \
&& echo "cleaning mkimage-profiles is DONE"
&& print_green "cleaning mkimage-profiles is DONE"
[ -d $TMP/hasher-sisyphus-64 ] && rm -rf $TMP/hasher-sisyphus-64/ \
&& echo "cleaning hasher-sisyphus is DONE"
&& print_green "cleaning hasher-sisyphus is DONE"
rmiso() {
rm -rf /tmp/.private/"$USER"/out/*
......@@ -19,18 +22,18 @@ rmiso() {
while [ -n "$1" ]; do
case "$1" in
-h|--help)
printf "Использование: ./bin/cleartmp [опции]\n\n"
printf "Использование: $0 [опции]\n\n"
printf "Опции:\n"
printf " --iso -i Удаляет iso файлы в /tmp/.private/USER/out\n"
exit 0
;;
--iso|-i)
rmiso
echo "iso файлы удалены"
print_green "iso файлы удалены"
shift
;;
esac
shift
done
echo "DONE"
print_green "DONE"
#!/bin/bash
print_error() {
printf "\033[1;31m%s\033[0m\n" "$1"
}
print_green() {
printf "\033[1;32m%s\033[0m\n" "$1"
}
print_yellow() {
printf "\033[1;33m%s\033[0m\n" "$1"
}
print_blue() {
printf "\033[1;34m%s\033[0m\n" "$1"
}
print_red() {
printf "\033[1;31m%s\033[0m\n" "$1"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment