Skip to content

Commit

Permalink
T | get bds version | use RZG's scripts get bds version
Browse files Browse the repository at this point in the history
  • Loading branch information
FTS427 committed Aug 15, 2024
1 parent d64e495 commit 80d0998
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ jobs:
run: |
mkdir ll
mv .\LICENSE .\ll\LL_Easier_LICENSE
cd .\scripts
Invoke-WebRequest -Uri https://github.com/futrime/lip/releases/latest/download/lip-windows-amd64.zip -Outfile .\lip.zip
Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2401-x64.exe -Outfile .\7z_installer.exe
.\7z_installer.exe
unzip lip.zip
Invoke-WebRequest -Uri https://github.com/futrime/lip/releases/latest/download/lip-windows-amd64.zip -Outfile .\scripts\lip.zip
Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2401-x64.exe -Outfile .\scripts\7z_installer.exe
.\scripts\7z_installer.exe
unzip .\scripts\lip.zip -d .\scripts\
"$env:GITHUB_WORKSPACE\scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: 🧰 Install LeviLamina
Expand Down Expand Up @@ -69,13 +68,14 @@ jobs:
run: |
user_scripts.ps1
- name: 📂 Remove BDS
- name: 📂 Remove BDS & Get BDS Version
id: get_bds_core_version
working-directory: ll
run: |
$file = Get-ChildItem -Path .\.cache\bdsdown\ -File | Select-Object -First 1
"bds_core_version=$(echo $file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Remove-Item -Path $file.FullName
#$file = Get-ChildItem -Path .\.cache\bdsdown\ -File | Select-Object -First 1
#"bds_core_version=$(echo $file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
#Remove-Item -Path $file.FullName
"bds_core_version=$(python ..\scripts\get_bds_version.py)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
rm .\behavior_packs -Force -Recurse
rm .\definitions -Force -Recurse
rm .\resource_packs -Force -Recurse
Expand Down
23 changes: 23 additions & 0 deletions scripts/get_bds_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import json
import re
try:

with open(".\\.lip\\metadata\\github.com%2FLiteLDev%2Fbds.json") as file:
json_data = file.read()
except FileNotFoundError:
print("File not found")
raise SystemExit
except Exception as e:
print(e)
raise SystemExit
data = json.loads(json_data)

post_install_command = data['commands']['post_install'][0]
match = re.search(r'version://windows/([^\\]+)', post_install_command)

if match:
version_number = match.group(1)
print(version_number)
else:
print("???")

0 comments on commit 80d0998

Please sign in to comment.