mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-12-24 15:11:30 +00:00
70 lines
2.7 KiB
JSON
70 lines
2.7 KiB
JSON
{
|
|
"version": "1.3.0",
|
|
"license": "MIT",
|
|
"url": "https://win.rustup.rs/?version=1.3.0#/rustup-init.exe",
|
|
"hash": "849123cd17092be5bd709cdd61d435ccade181f6df54fa40b18837b41466f559",
|
|
"depends": "vcredist2015",
|
|
"homepage": "https://github.com/rust-lang-nursery/rustup.rs",
|
|
"checkver": "github",
|
|
"autoupdate": {
|
|
"url": "https://win.rustup.rs/?version=$version#/rustup-init.exe"
|
|
},
|
|
"persist": [
|
|
".cargo",
|
|
".rustup"
|
|
],
|
|
"post_install": "
|
|
# Copy the installed cargo directory to the rustup persistent data directory
|
|
$cargoFolder = \"$env:USERPROFILE\\.cargo\"
|
|
$cargoFolderDestination = \"$persist_dir\\.cargo\"
|
|
if(Test-Path $cargoFolder)
|
|
{
|
|
if(Test-Path $cargoFolderDestination)
|
|
{
|
|
Write-Host -F yellow \"Removing existing .cargo folder from scoop's persistent rustup data directory.\"
|
|
Remove-Item -Recurse $cargoFolderDestination
|
|
}
|
|
Write-Host -F yellow \"Moving '$cargoFolder' to '$persist_dir'\"
|
|
Move-Item -Force \"$cargoFolder\" \"$persist_dir\"
|
|
}
|
|
|
|
# Copy the installed rustup directory to the rustup persistent data directory
|
|
$rustupFolder = \"$env:USERPROFILE\\.rustup\"
|
|
$rustupFolderDestination = \"$persist_dir\\.rustup\"
|
|
$multirustShortcut = \"$env:USERPROFILE\\.multirust\"
|
|
if(Test-Path $rustupFolder)
|
|
{
|
|
if(Test-Path $rustupFolderDestination)
|
|
{
|
|
Write-Host -F yellow \"Removing existing .rustup folder from scoop's persistent rustup data directory.\"
|
|
[System.IO.Directory]::Delete($rustupFolderDestination,$true)
|
|
|
|
}
|
|
Write-Host -F yellow \"Moving '$rustupFolder' to '$persist_dir'\"
|
|
Move-Item -Force \"$rustupFolder\" \"$persist_dir\"
|
|
if(Test-Path $multirustShortcut)
|
|
{
|
|
Write-Host -F yellow \"Removing old multirust junction.\"
|
|
[System.IO.Directory]::Delete($multirustShortcut,$true)
|
|
}
|
|
}
|
|
",
|
|
"env_add_path": ".cargo\\bin",
|
|
"env_set": {
|
|
"CARGO_HOME": "$persist_dir\\.cargo",
|
|
"RUSTUP_HOME": "$persist_dir\\.rustup"
|
|
},
|
|
"notes": "You'll need to restart powershell/cmd to have it reload the environment variables so rustup will work correctly",
|
|
"installer": {
|
|
"script": "
|
|
& \"$dir\\rustup-init.exe\" -y --no-modify-path
|
|
"
|
|
},
|
|
"uninstaller": {
|
|
"script": "
|
|
[Environment]::SetEnvironmentVariable('RUSTUP_HOME',$null,'User')
|
|
[Environment]::SetEnvironmentVariable('CARGO_HOME',$null,'User')
|
|
"
|
|
}
|
|
}
|