diff options
author | ene <ene@sils.li> | 2023-02-25 07:54:37 +0100 |
---|---|---|
committer | ene <ene@sils.li> | 2023-02-25 07:54:37 +0100 |
commit | 06696ca201682f63ea50da3ab41d992ed6b61816 (patch) | |
tree | 93152237a2e968cd433d1ca21671dcba52e772b8 /home-manager/packages/scripts/deprecated/java_compiler/lib | |
parent | Fix(hosts): Update UUIDs for mammun hosts (diff) | |
download | nixos-config-06696ca201682f63ea50da3ab41d992ed6b61816.tar.gz nixos-config-06696ca201682f63ea50da3ab41d992ed6b61816.zip |
Feat(packages): Add my scripts
Diffstat (limited to 'home-manager/packages/scripts/deprecated/java_compiler/lib')
-rwxr-xr-x | home-manager/packages/scripts/deprecated/java_compiler/lib | 41 |
1 files changed, 41 insertions, 0 deletions
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"; +} |