Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix update.sh Dockerfile status reporting#2308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
PeterDaveHello wants to merge1 commit intonodejs:main
base:main
Choose a base branch
Loading
fromPeterDaveHello:fix-update-sh-status

Conversation

@PeterDaveHello
Copy link
Member

Description

Clarifyupdate.sh status messages by comparing each generated Dockerfile with the existing file before replacing it. Move the Yarn version update ahead of the comparison and emit either “updated” when the content changes or “already up to date.” when it does not.

GitHub Copilot Summary

This pull request refactors the logic for updating Dockerfiles in theupdate_node_version() function inupdate.sh. The main change is a switch from usingdiff tocmp for file comparison, and updating the messaging and cleanup flow for temporary files.

Improvements to update logic:

  • Replaced the use ofdiff -q withcmp -s to compare${dockerfile}-tmp and${dockerfile}, simplifying the check for file changes.
  • Updated messaging to use theinfo function for consistent output when a Dockerfile is already up to date or has been updated.
  • Improved cleanup by removing the temporary file${dockerfile}-tmp if no changes are detected, and only moving it to${dockerfile} when updates are made.

Motivation and Context

Previous runs could print “updated!” even when the final Dockerfile was unchanged, leading to confusing output aftergit status showed no diffs. This change makes the script’s messaging align with the actual state of the files.

Testing Details

  • ./update.sh 20 bookworm
  • ./update.sh 22

Example Output(if appropriate)

Updating version 20...20/bookworm/Dockerfile already up to date.Done!

Types of changes

  • Documentation
  • Version change (Update, remove or add more Node.js versions)
  • Variant change (Update, remove or add more variants, or versions of variants)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (none of the above)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read theCONTRIBUTING.md document.
  • All new and existing tests passed.

Compare each generated Dockerfile with its existing copy beforereplacing it, so the script only announces an update when the contentactually changes. Otherwise keep the original file and print an'already up to date' message to eliminate false positives.
Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Dockerfile update logic inupdate.sh to improve efficiency and consistency. The main goal is to avoid unnecessary file operations and use consistent output messaging.

  • Moved the YARN_VERSION sed operation to always execute before comparison (when SKIP is false)
  • Changed file comparison fromdiff -q tocmp -s and added conditional handling to avoid overwriting unchanged files
  • Standardized output messages to use theinfo function instead ofecho

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@PeterDaveHello

[8]ページ先頭

©2009-2025 Movatter.jp