Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jul 22, 2025

Description

This pull request refactors the Update-FontsData.ps1 script to improve readability, simplify command execution, and enhance functionality. The most significant changes include replacing Invoke-NativeCommand with the Run alias, restructuring the command execution logic, and refining the behavior for detecting and committing changes.

Command Execution Refactor

  • Replaced Invoke-NativeCommand with the Run alias. This change affects all Git-related operations, such as fetching, checking out branches, merging, and pushing changes.
  • Updated parameter handling for the $Command argument to treat the first element as the command and subsequent elements as arguments, simplifying the way commands are constructed and executed.

Improved Change Detection and Commit Workflow

  • Enhanced the logic for detecting changes by reversing the condition to immediately exit if no changes are detected, reducing unnecessary processing.
  • Simplified the diff and commit process by removing redundant checks and ensuring staged changes are handled consistently.

Minor Adjustments

  • Adjusted branch naming conventions for auto-generated branches to improve clarity (e.g., changed auto-font-update-$timeStamp to auto-update-font-$timeStamp).
  • Removed unnecessary logging blocks to streamline the script output.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@MariusStorhaug MariusStorhaug self-assigned this Jul 22, 2025
Copilot AI review requested due to automatic review settings July 22, 2025 17:05
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner July 22, 2025 17:05
Copy link
Contributor

Copilot AI 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 pull request refactors the Update-FontsData.ps1 script by replacing Invoke-NativeCommand with a Run alias and simplifying the parameter handling approach. The refactor improves code readability while maintaining the same core functionality for updating font data.

Key changes include:

  • Replaced Invoke-NativeCommand function calls with Run alias throughout the script
  • Simplified parameter structure by using a single array parameter with array slicing
  • Improved change detection logic by inverting the condition for early exit

@MariusStorhaug MariusStorhaug merged commit 37db98e into main Jul 22, 2025
36 checks passed
@MariusStorhaug MariusStorhaug deleted the fix branch July 22, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants