local/bin/package-lister: Add messages for each generated profile.
parent
4aded805b5
commit
2589e18513
|
@ -6,6 +6,25 @@
|
|||
PKG_ROOT="$HOME/.package-lists"
|
||||
mkdir -p "$PKG_ROOT"
|
||||
|
||||
GREEN='\033[0;32m\033[1m'
|
||||
YELLOW='\033[0;33m\033[1m'
|
||||
BOLD='\033[0m\033[1m'
|
||||
NORMAL='\033[0m'
|
||||
section() {
|
||||
echo -e "$GREEN==> $@$NORMAL"
|
||||
}
|
||||
message() {
|
||||
echo -e "$YELLOW:: $@$NORMAL"
|
||||
}
|
||||
status() {
|
||||
local title=$1
|
||||
local body=$2
|
||||
|
||||
[ -z "$body" ] && return
|
||||
message "$title"
|
||||
echo "$body"
|
||||
}
|
||||
|
||||
## Arch Linux
|
||||
if command -v pacman >/dev/null 2>&1; then
|
||||
pacman -Qneq | LC_ALL=C sort >"$PKG_ROOT/arch-official"
|
||||
|
@ -21,9 +40,11 @@ fi
|
|||
|
||||
## Guix
|
||||
if command -v guix >/dev/null 2>&1; then
|
||||
section "Listing Guix default profile"
|
||||
guile --no-auto-compile -s ~/.config/guix/profile-to-manifest.scm ~/.guix-profile >"$PKG_ROOT/guix-manifest.scm"
|
||||
for i in ~/.guix-extra-profiles/*; do
|
||||
profile=$i/$(basename "$i")
|
||||
section "Listing Guix profile" $(basename "$i")
|
||||
if [ -d "$profile" ]; then
|
||||
guile --no-auto-compile -s ~/.config/guix/profile-to-manifest.scm "$profile" >"$PKG_ROOT/guix-$(basename "$i")-manifest.scm"
|
||||
fi
|
||||
|
@ -31,20 +52,5 @@ if command -v guix >/dev/null 2>&1; then
|
|||
done
|
||||
fi
|
||||
|
||||
YELLOW='\033[0;33m\033[1m'
|
||||
BOLD='\033[0m\033[1m'
|
||||
NORMAL='\033[0m'
|
||||
message() {
|
||||
echo -e "$YELLOW:: $@$NORMAL"
|
||||
}
|
||||
status() {
|
||||
local title=$1
|
||||
local body=$2
|
||||
|
||||
[ -z "$body" ] && return
|
||||
message "$title"
|
||||
echo "$body"
|
||||
}
|
||||
|
||||
status "Unpushed files" "$(git -C "$PKG_ROOT" diff --cached --name-only .)"
|
||||
status "Unstaged files" "$(git -C "$PKG_ROOT" diff --name-only .)"
|
||||
status "Unpushed files:" "$(git -C "$PKG_ROOT" diff --cached --name-only .)"
|
||||
status "Unstaged files:" "$(git -C "$PKG_ROOT" diff --name-only .)"
|
||||
|
|
Loading…
Reference in New Issue