Skip to content

Commit 4286f05

Browse files
authored
Use cargo binstall in setup scripts (#340)
* use cargo binstall if it exists * powershell
1 parent 8edce35 commit 4286f05

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/scripts/setup.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ https://learn.microsoft.com/windows/package-manager/winget/
198198

199199
Write-Host
200200
Write-Host 'Installing Rust tools...' -ForegroundColor Yellow
201-
cargo install cargo-watch
202-
cargo install sqlx-cli
201+
if (Get-Command cargo-binstall -ea 0) { cargo binstall cargo-watch sqlx-cli } else { cargo install cargo-watch sqlx-cli }
203202
if ($LASTEXITCODE -ne 0) {
204203
Exit-WithError 'Failed to install Rust tools'
205204
}

packages/scripts/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ esac
184184
if [ "${CI:-}" != "true" ]; then
185185
echo "installing rust tools..."
186186
_tools="cargo-watch sqlx-cli"
187-
echo "$_tools" | xargs cargo install
187+
echo "$_tools" | xargs cargo $(has cargo-binstall && echo binstall || echo install)
188188
fi
189189

190190
echo 'your machine has been setup for onelauncher development!'

0 commit comments

Comments
 (0)