Skip to content

Fixed: No snap installed print - #83

Merged
gvatsal60 merged 11 commits into
masterfrom
fix/snap_instal
Sep 7, 2025
Merged

gvatsal60 merged 11 commits into
masterfrom
fix/snap_instal

Conversation

@gvatsal60

@gvatsal60 gvatsal60 commented Jul 27, 2025

Copy link
Copy Markdown
Owner

This pull request includes several improvements to the update script and related configuration files, focusing on enhanced error handling, code robustness, and better compatibility with Debian-based systems. Additionally, a new Codacy badge was added to the README.md for code quality tracking. The most important changes are grouped below:

Script robustness and compatibility improvements:

  • Improved the cleanup_snapd function in .update.sh to handle errors gracefully, process snap list output more robustly, and avoid issues when no snaps are installed. Variable naming was also made more consistent.
  • Updated all case statements in .update.sh to quote the ${ADJUSTED_ID} variable, preventing potential word splitting and improving script safety. [1] [2] [3]
  • Fixed the find command in the update_os_pkg function to correctly check for files in /var/lib/apt/lists/, enhancing Debian compatibility.

Configuration and documentation updates:

  • Changed the dev container base image in .devcontainer/devcontainer.json from javascript-node to base:debian, aligning the development environment with Debian-based systems.
  • Added a Codacy code quality badge to the README.md for improved project quality visibility.This pull request refactors the cleanup_snapd function in .update.sh to improve efficiency and handle edge cases more robustly. The key changes include processing the snap list output only once, adding a check for cases where no snaps are installed, and improving variable naming for clarity.

Improvements to efficiency and robustness:

  • Refactored the snap list command to store its output in a variable (snap_output) and process it only once, reducing redundant calls.
  • Added a check to handle cases where no snaps are installed, ensuring the function exits early in such scenarios.

Code readability and maintainability:

  • Renamed variables from snapname and revision to snap_name and revision for consistency and clarity.

@gvatsal60 gvatsal60 self-assigned this Jul 27, 2025
Copilot AI review requested due to automatic review settings July 27, 2025 09:46
@gvatsal60 gvatsal60 added the documentation Improvements or additions to documentation label Jul 27, 2025

This comment was marked as outdated.

@gvatsal60
gvatsal60 enabled auto-merge July 27, 2025 09:47
@gvatsal60
gvatsal60 disabled auto-merge July 27, 2025 09:47
gvatsal60 and others added 2 commits August 2, 2025 19:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gvatsal60
gvatsal60 requested a review from Copilot August 2, 2025 13:36

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gvatsal60
gvatsal60 requested a review from Copilot August 2, 2025 13:42

This comment was marked as outdated.

@gvatsal60
gvatsal60 requested a review from Copilot September 7, 2025 14:59

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gvatsal60
gvatsal60 requested a review from Copilot September 7, 2025 15:01
@gvatsal60 gvatsal60 added bug Something isn't working enhancement New feature or request labels Sep 7, 2025

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gvatsal60
gvatsal60 requested a review from Copilot September 7, 2025 15:03

This comment was marked as outdated.

@gvatsal60
gvatsal60 requested a review from Copilot September 7, 2025 15:05

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gvatsal60
gvatsal60 requested a review from Copilot September 7, 2025 15:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the cleanup_snapd function to improve efficiency and handle edge cases, while also making minor code quality improvements across several files.

  • Optimizes the cleanup_snapd function by caching snap list output and adding error handling for cases where no snaps are installed
  • Improves variable naming consistency by using snake_case for snap-related variables
  • Adds consistent quoting for shell variables and fixes a file search command parameter

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
README.md Adds Codacy badge to project documentation
.update.sh Refactors cleanup_snapd function for efficiency and adds consistent variable quoting
.devcontainer/devcontainer.json Updates base container image from Node.js to Debian

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread .update.sh
@gvatsal60
gvatsal60 merged commit 3df1580 into master Sep 7, 2025
9 checks passed
@gvatsal60
gvatsal60 deleted the fix/snap_instal branch September 7, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants