Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jul 21, 2025

Description

This pull request updates the scripts/Update-FontsData.ps1 script to improve the retrieval of font data from the Nerd Fonts repository. The changes replace the use of Invoke-RestMethod with a more structured approach using custom PowerShell functions, enhancing readability and maintainability.

Enhancements to font data retrieval:

  • Replaced low-level commands with GitHub PowerShell commands:
    • Invoke-RestMethod with Get-GitHubRelease to fetch the latest release data from the Nerd Fonts repository.
    • browser_download_url property under assets on a release, with Get-GitHubReleaseAsset to fetch the URL of the assets that are added to the release.
    • Updated the loop to use [PSCustomObject] instead of [ordered]@ for better view and troubleshooting.

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 21, 2025
Copilot AI review requested due to automatic review settings July 21, 2025 08:25
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner July 21, 2025 08:25
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 font data retrieval mechanism in the Update-FontsData.ps1 script to use GitHub PowerShell commands instead of direct REST API calls. The changes aim to improve code readability and maintainability by leveraging more structured PowerShell functions.

Key changes include:

  • Replacing Invoke-RestMethod with Get-GitHubRelease for fetching release data
  • Using Get-GitHubReleaseAsset instead of direct property access for asset URLs
  • Converting object creation from hashtables to [PSCustomObject] for better structure

@MariusStorhaug MariusStorhaug merged commit 727469f into main Jul 21, 2025
58 of 60 checks passed
@MariusStorhaug MariusStorhaug deleted the useGHPwsh branch July 21, 2025 21:03
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