Skip to content

Skip installation when latest version already installed#47

Merged
joaomoreno merged 4 commits intomainfrom
copilot/fix-install-scripts-version-check
Nov 19, 2025
Merged

Skip installation when latest version already installed#47
joaomoreno merged 4 commits intomainfrom
copilot/fix-install-scripts-version-check

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Task: Add version check to install scripts

Objective: Modify install scripts to bail out early if the installed version matches the latest version

Plan:

  • Explore repository and understand structure
  • Build and test the project
  • Identify install scripts: static/install.sh and static/install.ps1
  • Confirm docfind --version outputs format: docfind X.Y.Z
  • Modify static/install.sh to check current version before downloading
  • Modify static/install.ps1 to check current version before downloading
  • Test the modified scripts manually
  • Run code review (no issues found)
  • Run security checks (no code changes in CodeQL-supported languages)
  • Address PR feedback: Reverted wasm/Cargo.toml changes

Implementation Complete ✅

Both install scripts now intelligently check for existing installations:

Bash Script (install.sh)

  • Added get_current_version() function that extracts version from docfind --version
  • Modified main() to check current version before downloading
  • Handles both v0.5.1 and 0.5.1 version formats
  • Exits with status 0 and helpful message when latest version is already installed

PowerShell Script (install.ps1)

  • Added Get-CurrentVersion function with error handling
  • Modified Main() to check current version before downloading
  • Handles both v0.5.1 and 0.5.1 version formats
  • Exits with status 0 and helpful message when latest version is already installed

Changes Made

  • install.sh: Added get_current_version() function and version check in main()
  • install.ps1: Added Get-CurrentVersion function and version check in Main()
  • wasm/Cargo.toml: Reverted temporary build environment changes (per PR feedback)
Original prompt

This section details on the original issue you should resolve

<issue_title>Install scripts should bail out early if version matches the latest version</issue_title>
<issue_description>Use docfind --version to check.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 19, 2025 12:48
Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
…y installed

Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Undo this.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Reverted the wasm/Cargo.toml changes in commit dca7637.

Copilot AI changed the title [WIP] Fix install scripts to exit early on version match Skip installation when latest version already installed Nov 19, 2025
Copilot AI requested a review from joaomoreno November 19, 2025 13:03
wasm/Cargo.toml Outdated
Comment on lines 13 to 15

[package.metadata.wasm-pack.profile.release]
wasm-opt = false
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Remove this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already removed in commit dca7637. The wasm/Cargo.toml file is now back to its original state.

Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
@joaomoreno joaomoreno marked this pull request as ready for review November 19, 2025 13:12
@joaomoreno joaomoreno enabled auto-merge (squash) November 19, 2025 13:12
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 19, 2025
@joaomoreno joaomoreno merged commit a6319e7 into main Nov 19, 2025
12 of 15 checks passed
@joaomoreno joaomoreno deleted the copilot/fix-install-scripts-version-check branch November 19, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install scripts should bail out early if version matches the latest version

3 participants