Skip to content

Commit

Permalink
sync fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaption authored Mar 3, 2024
1 parent eef8db5 commit 4c6f34c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions LunarClientTools.bat
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ goto :menu
:json-archive
@rem sync with the archive
@Echo off
del "%userprofile%"\.lunarclient\.lct-cache\* /Q > nul
rmdir /s /q "%userprofile%"\.lunarclient\.lct-cache\ > nul
del "%userprofile%"\.lunarclient\.lct-cache\* /Q 2>nul
rmdir /s /q "%userprofile%"\.lunarclient\.lct-cache\ 2>nul
mkdir "%userprofile%"\.lunarclient\".lct-cache"
powershell -Command "$url = 'https://raw.githubusercontent.com/Vaption/LunarClientProfiles/main/profiles/data.json'; $filename = [System.IO.Path]::GetFileName($url); wget -Uri $url -OutFile ('%userprofile%\.lunarclient\.lct-cache\' + $filename)"
Powershell -Nop -C "$profiles = (Get-Content '%userprofile%\.lunarclient\.lct-cache\data.json' | ConvertFrom-Json).profiles; foreach ($profile in $profiles) { $profile.link | Out-File -FilePath ('%userprofile%\.lunarclient\.lct-cache\{0}.txt' -f $profile.name) }"
cls
echo ###################################################################
echo ## Lunar Client Tools Script ##
Expand Down Expand Up @@ -243,8 +246,8 @@ for /d %%i in ("%settingsFolder%\*") do (
if %totalProfiles% gtr 8 (
echo Error: More than eight profiles are present!
echo Please navigate to .lunarclient\settings\game and remove some profiles before running the command.
del "%userprofile%"\.lunarclient\.lct-cache\* /Q > nul
rmdir /s /q "%userprofile%"\.lunarclient\.lct-cache\ > nul
del "%userprofile%"\.lunarclient\.lct-cache\* /Q 2>nul
rmdir /s /q "%userprofile%"\.lunarclient\.lct-cache\ 2>nul
pause >nul
exit /b
) else (
Expand Down Expand Up @@ -273,8 +276,8 @@ set "jsonContent=!jsonContent!]"
echo.
echo Successfully generated and replaced profile_manager.json
echo Operation successful.
del "%userprofile%"\.lunarclient\.lct-cache\* /Q > nul
rmdir /s /q "%userprofile%"\.lunarclient\.lct-cache\ > nul
del "%userprofile%"\.lunarclient\.lct-cache\* /Q 2>nul
rmdir /s /q "%userprofile%"\.lunarclient\.lct-cache\ 2>nul
pause >nul
cls
goto :menu
Expand Down

0 comments on commit 4c6f34c

Please sign in to comment.