mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-06 01:16:34 +00:00
add no color function
This commit is contained in:
8
buildpkg
8
buildpkg
@@ -435,6 +435,9 @@ parse_options() {
|
||||
-cc|--check-checksum)
|
||||
CHECK_CHECKSUM=yes
|
||||
;;
|
||||
--no-color)
|
||||
NO_COLOR=yes
|
||||
;;
|
||||
-sd|--source-dir)
|
||||
if [ ! "$2" ]; then
|
||||
msg "Option '$1' require an argument (source path for package)."
|
||||
@@ -475,6 +478,11 @@ main() {
|
||||
|
||||
parse_options "$@"
|
||||
|
||||
### DISABLE COLOR ###
|
||||
if [ "$NO_COLOR" ]; then
|
||||
nocolor
|
||||
fi
|
||||
|
||||
### SET OUTPUT PATH FOR PACKAGE ###
|
||||
if [ $OUTPUT_PKG ]; then
|
||||
PACKAGE_DIR="$OUTPUT_PKG"
|
||||
|
||||
20
functions
20
functions
@@ -60,6 +60,26 @@ rm_silent() {
|
||||
command rm -d "$@" 2> /dev/null
|
||||
}
|
||||
|
||||
nocolor() {
|
||||
|
||||
color_red=''
|
||||
color_green=''
|
||||
color_yellow=''
|
||||
color_blue=''
|
||||
color_purple=''
|
||||
color_cyan=''
|
||||
color_gray=''
|
||||
color_bred=''
|
||||
color_bgreen=''
|
||||
color_byellow=''
|
||||
color_bblue=''
|
||||
color_bpurple=''
|
||||
color_bcyan=''
|
||||
color_bgray=''
|
||||
color_reset=''
|
||||
|
||||
}
|
||||
|
||||
updatesystemdb() {
|
||||
|
||||
# update desktop database
|
||||
|
||||
@@ -276,6 +276,9 @@ parse_options() {
|
||||
--no-backup)
|
||||
NO_BACKUP=yes
|
||||
;;
|
||||
--no-color)
|
||||
NO_COLOR=yes
|
||||
;;
|
||||
*.spkg.txz)
|
||||
[ -f $1 ] && PKGNAME=$1 || msg "${color_red}$1${color_reset} not exist."
|
||||
;;
|
||||
@@ -295,6 +298,11 @@ main() {
|
||||
|
||||
parse_options "$@"
|
||||
|
||||
### DISABLE COLOR ###
|
||||
if [ "$NO_COLOR" ]; then
|
||||
nocolor
|
||||
fi
|
||||
|
||||
### LOAD CONFIGURATION FILE ###
|
||||
if [ -f $CONF_FILE ]; then
|
||||
. $CONF_FILE
|
||||
|
||||
@@ -151,6 +151,9 @@ parse_options() {
|
||||
--no-postremove)
|
||||
NO_POSTREMOVE=yes
|
||||
;;
|
||||
--no-color)
|
||||
NO_COLOR=yes
|
||||
;;
|
||||
*)
|
||||
RMNAME=$1
|
||||
;;
|
||||
@@ -166,6 +169,11 @@ main() {
|
||||
|
||||
parse_options "$@"
|
||||
|
||||
### DISABLE COLOR ###
|
||||
if [ "$NO_COLOR" ]; then
|
||||
nocolor
|
||||
fi
|
||||
|
||||
### LOAD CONFIGURATION FILE ###
|
||||
if [ -f $CONF_FILE ]; then
|
||||
. $CONF_FILE
|
||||
|
||||
8
scratch
8
scratch
@@ -362,6 +362,9 @@ parse_options() {
|
||||
--sync)
|
||||
SYNC_PORTS=yes
|
||||
;;
|
||||
--no-color)
|
||||
NO_COLOR=yes
|
||||
;;
|
||||
-dp|--dependent)
|
||||
if [ ! "$2" ]; then
|
||||
info "Option '$1' require an argument (package to show its dependent)"
|
||||
@@ -441,6 +444,11 @@ main() {
|
||||
|
||||
parse_options "$@"
|
||||
|
||||
### DISABLE COLOR ###
|
||||
if [ "$NO_COLOR" ]; then
|
||||
nocolor
|
||||
fi
|
||||
|
||||
### LOAD CONFIGURATION FILE ###
|
||||
if [ -f $CONF_FILE ]; then
|
||||
. $CONF_FILE
|
||||
|
||||
Reference in New Issue
Block a user