mirror of
https://github.com/kuhyx/scripts.git
synced 2026-11-10 20:07:12 +01:00
feat: make multi package instalation possible
This commit is contained in:
parent
f1cba3f4c2
commit
b4da680d61
@ -26,28 +26,28 @@ function show_help() {
|
|||||||
function display_operation() {
|
function display_operation() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-S|-Sy|-S\ *)
|
-S|-Sy|-S\ *)
|
||||||
echo -e "${BLUE}Installing packages...${NC}"
|
echo -e "${BLUE}Installing packages...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
-Syu|-Syyu)
|
-Syu|-Syyu)
|
||||||
echo -e "${BLUE}Updating system...${NC}"
|
echo -e "${BLUE}Updating system...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
-R|-Rs|-Rns|-R\ *)
|
-R|-Rs|-Rns|-R\ *)
|
||||||
echo -e "${YELLOW}Removing packages...${NC}"
|
echo -e "${YELLOW}Removing packages...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
-Ss|-Ss\ *)
|
-Ss|-Ss\ *)
|
||||||
echo -e "${CYAN}Searching for packages...${NC}"
|
echo -e "${CYAN}Searching for packages...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
-Q|-Qs|-Qi|-Ql|-Q\ *)
|
-Q|-Qs|-Qi|-Ql|-Q\ *)
|
||||||
echo -e "${CYAN}Querying package database...${NC}"
|
echo -e "${CYAN}Querying package database...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
-U|-U\ *)
|
-U|-U\ *)
|
||||||
echo -e "${BLUE}Installing local packages...${NC}"
|
echo -e "${BLUE}Installing local packages...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
-Scc)
|
-Scc)
|
||||||
echo -e "${YELLOW}Cleaning package cache...${NC}"
|
echo -e "${YELLOW}Cleaning package cache...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${CYAN}Executing pacman command...${NC}"
|
echo -e "${CYAN}Executing pacman command...${NC}" >&2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ fi
|
|||||||
display_operation "$1"
|
display_operation "$1"
|
||||||
|
|
||||||
# Echo the command that's about to be executed
|
# Echo the command that's about to be executed
|
||||||
echo -e "${GREEN}Executing:${NC} $PACMAN_BIN $@"
|
echo -e "${GREEN}Executing:${NC} $PACMAN_BIN $@" >&2
|
||||||
|
|
||||||
# Record start time for statistics
|
# Record start time for statistics
|
||||||
start_time=$(date +%s)
|
start_time=$(date +%s)
|
||||||
@ -228,9 +228,9 @@ duration=$((end_time - start_time))
|
|||||||
|
|
||||||
# Display results
|
# Display results
|
||||||
if [ $exit_code -eq 0 ]; then
|
if [ $exit_code -eq 0 ]; then
|
||||||
echo -e "${GREEN}Command completed successfully in ${duration}s.${NC}"
|
echo -e "${GREEN}Command completed successfully in ${duration}s.${NC}" >&2
|
||||||
else
|
else
|
||||||
echo -e "${RED}Command failed with exit code ${exit_code}.${NC}"
|
echo -e "${RED}Command failed with exit code ${exit_code}.${NC}" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Display some helpful tips depending on the operation
|
# Display some helpful tips depending on the operation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user