Skip to content

Commit

Permalink
Build script update to fix missing .pyc bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
instance-id committed Mar 23, 2024
1 parent e4314bb commit 779c2af
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env pwsh
#!/usr/bin/env -S pwsh -noProfile -nologo

# .\build.ps1 -Zip -Version v0.1.0
Param (
Expand Down Expand Up @@ -76,6 +76,19 @@ if ($Version) {
Move-Item -Path $destination1\python3.10libs -Destination $folderVer\$searcher\python3.10libs
Move-Item -Path $destination1\toolbar -Destination $folderVer\$searcher\toolbar

# --| Move and rename compiled runtime files -----
$searcherLibs = [System.IO.Path]::Combine($folderVer, $searcher, "python3.10libs", "searcher")
$cachePath = [System.IO.Path]::Combine($searcherLibs, "__pycache__")
$compiledFiles = Get-ChildItem -Path $cachePath -Recurse -Include "*.pyc", "*.pyo"

# --| Remove 'cpython-310' from the file names ---
foreach ($file in $compiledFiles) {
$newName = $file.Name.Replace('.cpython-310', '')
$newPath = [System.IO.Path]::Combine($file.DirectoryName, $newName)
Rename-Item -Path $file.FullName -NewName $newName
Move-Item -Path $newPath -Destination $searcherLibs
}

$listfiles = Get-ChildItem $folderVer -Recurse -File -Include '*.md', '*.txt'
$old = '{#version}'
foreach ($file in $listfiles) {
Expand Down

0 comments on commit 779c2af

Please sign in to comment.