Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Enhanced Pod Interaction: Direct Shell Access and Log Viewing (#127)
Browse files Browse the repository at this point in the history
- Introducing the ability for users to directly jump into viewing pod logs or accessing the shell using `heavyscript pod --shell/--logs APPNAME`.
  • Loading branch information
Heavybullets8 authored Aug 17, 2023
1 parent 40366b0 commit 2f0cf99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion functions/pod/container_shell_or_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ container_shell_or_logs(){
cmd_get_app_names
cmd_check_app_names
cmd_header "$mode"
cmd_display_app_menu
if [[ -z $2 ]]; then
cmd_display_app_menu
else
app_name=$2
fi
cmd_get_pod
cmd_get_container

Expand Down
4 changes: 2 additions & 2 deletions functions/pod/handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ pod_handler() {
case "${args[0]}" in
-l | --logs)
# Call the function to display container logs
container_shell_or_logs "logs"
container_shell_or_logs "logs" "${args[1]}"
;;
-s | --shell)
# Call the function to open a shell for the container
container_shell_or_logs "shell"
container_shell_or_logs "shell" "${args[1]}"
;;
-h | --help)
# Call the function to display help for the pod command
Expand Down

0 comments on commit 2f0cf99

Please sign in to comment.