Skip to content

Commit 80d0998

Browse files
committed
T | get bds version | use RZG's scripts get bds version
1 parent d64e495 commit 80d0998

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

.github/workflows/pack.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ jobs:
3737
run: |
3838
mkdir ll
3939
mv .\LICENSE .\ll\LL_Easier_LICENSE
40-
cd .\scripts
41-
Invoke-WebRequest -Uri https://github.com/futrime/lip/releases/latest/download/lip-windows-amd64.zip -Outfile .\lip.zip
42-
Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2401-x64.exe -Outfile .\7z_installer.exe
43-
.\7z_installer.exe
44-
unzip lip.zip
40+
Invoke-WebRequest -Uri https://github.com/futrime/lip/releases/latest/download/lip-windows-amd64.zip -Outfile .\scripts\lip.zip
41+
Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2401-x64.exe -Outfile .\scripts\7z_installer.exe
42+
.\scripts\7z_installer.exe
43+
unzip .\scripts\lip.zip -d .\scripts\
4544
"$env:GITHUB_WORKSPACE\scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
4645
4746
- name: 🧰 Install LeviLamina
@@ -69,13 +68,14 @@ jobs:
6968
run: |
7069
user_scripts.ps1
7170
72-
- name: 📂 Remove BDS
71+
- name: 📂 Remove BDS & Get BDS Version
7372
id: get_bds_core_version
7473
working-directory: ll
7574
run: |
76-
$file = Get-ChildItem -Path .\.cache\bdsdown\ -File | Select-Object -First 1
77-
"bds_core_version=$(echo $file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
78-
Remove-Item -Path $file.FullName
75+
#$file = Get-ChildItem -Path .\.cache\bdsdown\ -File | Select-Object -First 1
76+
#"bds_core_version=$(echo $file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
77+
#Remove-Item -Path $file.FullName
78+
"bds_core_version=$(python ..\scripts\get_bds_version.py)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
7979
rm .\behavior_packs -Force -Recurse
8080
rm .\definitions -Force -Recurse
8181
rm .\resource_packs -Force -Recurse

scripts/get_bds_version.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import json
2+
import re
3+
try:
4+
5+
with open(".\\.lip\\metadata\\github.com%2FLiteLDev%2Fbds.json") as file:
6+
json_data = file.read()
7+
except FileNotFoundError:
8+
print("File not found")
9+
raise SystemExit
10+
except Exception as e:
11+
print(e)
12+
raise SystemExit
13+
data = json.loads(json_data)
14+
15+
post_install_command = data['commands']['post_install'][0]
16+
match = re.search(r'version://windows/([^\\]+)', post_install_command)
17+
18+
if match:
19+
version_number = match.group(1)
20+
print(version_number)
21+
else:
22+
print("???")
23+

0 commit comments

Comments
 (0)