From d4ba30d3f2054669a806882e4e465b1824fc2825 Mon Sep 17 00:00:00 2001 From: Paul T Date: Mon, 1 Apr 2024 09:22:22 -0400 Subject: [PATCH] chore: read version from toml when installing package locally Updated script to read the package version from the toml file --- scripts/install_package_locally.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/install_package_locally.ps1 b/scripts/install_package_locally.ps1 index fc7cdbf..bc35e33 100644 --- a/scripts/install_package_locally.ps1 +++ b/scripts/install_package_locally.ps1 @@ -1,3 +1,10 @@ +# requires the PSToml cmdlet to be installed +# https://github.com/jborean93/PSToml?tab=readme-ov-file +# Install-Module -Name PSToml -Scope AllUsers + +$typst_toml = ConvertFrom-Toml (Get-Content "$PSScriptRoot/../typst.toml" -Raw) +Write-Host 'Package version: ' $typst_toml.package.version $Source = "$PSScriptRoot/../*" -$Destination = "$env:LOCALAPPDATA/typst/packages/local/modern-cv/0.1.0" +$Destination = "$env:LOCALAPPDATA/typst/packages/local/modern-cv/$($typst_toml.package.version)" +New-Item -ItemType Directory -Path $Destination -Force Copy-Item -Path $Source -Destination $Destination -Recurse -Force