From 06696ca201682f63ea50da3ab41d992ed6b61816 Mon Sep 17 00:00:00 2001 From: ene Date: Sat, 25 Feb 2023 07:54:37 +0100 Subject: Feat(packages): Add my scripts --- .../packages/scripts/deprecated/java_compiler/lib | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 home-manager/packages/scripts/deprecated/java_compiler/lib (limited to 'home-manager/packages/scripts/deprecated/java_compiler/lib') diff --git a/home-manager/packages/scripts/deprecated/java_compiler/lib b/home-manager/packages/scripts/deprecated/java_compiler/lib new file mode 100755 index 00000000..8446d1ce --- /dev/null +++ b/home-manager/packages/scripts/deprecated/java_compiler/lib @@ -0,0 +1,41 @@ +#!/bin/sh +# shellcheck disable=SC2059,SC2066 + + + +out() { printf "$1 $2\n" "$(out2 "$@")"; } +out2() { shift 2; for i in "$*";do printf "$i";done; } + + +if [ "$noColor" = "yes" ];then +error() { >&2 out "==> ERROR:" "$*"; } >&2 +warning() { >&2 out "==> WARNING:" "$*"; } >&2 +msg() { out "==>" "$*"; } +msg2() { out " ->" "$*"; } + +readp() { printf "..> $1"; read -r "$2"; } + +else +error() { >&2 out "\033[1;91m==> ERROR:\033[0m" "\033[1;93m$*\033[0m"; } >&2 +warning() { >&2 out "\033[1;91m==> WARNING:\033[0m" "\033[1;93m$*\033[0m"; } >&2 +msg() { out "\033[1;96m==>\033[0m" "\033[1;93m$*\033[0m"; } +msg2() { out "\033[1;96m ->\033[0m" "\033[1;93m$*\033[0m"; } + +readp() { printf "\033[1;96m..>\033[0m \033[1;93m$1\033[0m"; read -r "$2"; } +fi + + + + + +dien() { error "$@" "failed"; exit 1; } +die() { error "$@"; exit 1; } + +clean() { awk '{if (NF) {if (!/^#/) {if (!/^[[:blank:]]*#/) {print $0}}}}' "$1"; } +# shellcheck disable=SC2294 +tmp() { + [ -d /tmp/LIB_FILE_TEMP_DIR/ ] || mkdir /tmp/LIB_FILE_TEMP_DIR/ + tmp=$(mktemp -p /tmp/LIB_FILE_TEMP_DIR/); + eval "$@" 1> "$tmp"; + echo "$tmp"; +} -- cgit 1.4.1