diff --git a/justfile b/justfile index c934802..514d1e8 100644 --- a/justfile +++ b/justfile @@ -1,9 +1,6 @@ alias e := export -alias ea := export-all alias r := refresh -alias ra := refresh-all alias u := update -alias ua := update-all set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] @@ -13,9 +10,9 @@ default: [private] [windows] _batchcmd cmd loader: - Get-ChildItem -Path versions\{{ loader }} -Directory | % { \ + Get-ChildItem -Path versions\{{ if loader == "all" { "*\\*" } else { loader } }} -Directory | % { \ Set-Location $_.FullName; \ - Write-Host "running {{ cmd }} in $_"; \ + Write-Host "running {{ cmd }} in" versions\loader\$_; \ Invoke-Expression "{{ cmd }}"; \ Pop-Location; \ } @@ -24,35 +21,26 @@ _batchcmd cmd loader: [macos] [private] _batchcmd cmd loader: - for d in versions/{{ loader }}/*/; do \ - cd "$d"; \ + for d in versions/{{ if loader == "all" { "*" } else { loader } }}/*/; do \ + pushd "$d" &> /dev/null; \ echo "running {{ cmd }} in $d..."; \ {{ cmd }}; \ - cd {{ invocation_directory() }}; \ + popd &> /dev/null; \ done -# all versions of will be exported as a modrinth modpack +# all versions of (or "all") will be exported as a modrinth modpack [linux] [macos] -export loader: && (_batchcmd "packwiz modrinth export; mv *.mrpack ../../../.build/" loader) - -mkdir -p .build/{{ loader }} +export loader: && (_batchcmd "packwiz modrinth export; mv *.mrpack ../../../build/" loader) + -mkdir -p build/ -# all versions of will be exported as a modrinth modpack +# all versions of (or "all") will be exported as a modrinth modpack [windows] -export loader: && (_batchcmd "packwiz modrinth export; Move-Item -Path *.mrpack -Destination ../../../.build" loader) - -New-Item -Type Directory -Path .build\{{ loader }} +export loader: && (_batchcmd "packwiz modrinth export; Move-Item -Force -Path *.mrpack -Destination ../../../build/" loader) + -New-Item -Force -Type Directory -Path build/ -# all versions of will have pack.toml refreshed +# all versions of (or "all") will have pack.toml & index.toml refreshed refresh loader: && (_batchcmd "packwiz refresh" loader) -# all versions of will be updated +# all versions of (or "all") will be updated update loader: && (_batchcmd "packwiz update --all" loader) - -# refresh all modpacks -refresh-all: (refresh "fabric") (refresh "quilt") - -# update all modpacks -update-all: (update "fabric") (update "quilt") - -# export all modpacks -export-all: (export "fabric") (export "quilt")