Skip to content

Instantly share code, notes, and snippets.

@semagnum
Created Oct 11, 2021
Embed
What would you like to do?
Build Blender addon zip file with versioning
$versionList = Select-String -Path ".\path-to-addon\__init__.py" -Pattern '"version":\s*\((\d+)\D*(\d+)\D*(\d+)\)'
$majorVersion = $versionList.Matches.Groups[1].Value
$minorVersion = $versionList.Matches.Groups[2].Value
$patchVersion = $versionList.Matches.Groups[3].Value
Get-ChildItem -Path "." -Directory | Where-Object BaseName -eq "addon-name" | Compress-Archive -DestinationPath ".\addon-name-$majorVersion-$minorVersion-$patchVersion.zip"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment