Guest User

Untitled

a guest
Dec 16th, 2021
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.84 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3.  
  4. # denice
  5. renice -n 9 -p $$
  6.  
  7. # assume the ncspot folder lies in the same dir as this script
  8. ncspot_dir=$(dirname "$0")/ncspot
  9. # and get the absolute path
  10. ncspot_dir=$(readlink -f $ncspot_dir)
  11.  
  12. # the toolchain to use
  13. toolchain='stable'
  14.  
  15.  
  16. cd $ncspot_dir
  17.  
  18. # i needed this, maybe it was a mistake
  19. rm Cargo.lock
  20.  
  21. # pull the changes from git
  22. git pull --ff-only
  23.  
  24. # only update the toolchain we need (if you switch toolchains, you have to change this)
  25. #rustup update
  26. echo ==rustup update==
  27. rustup update $toolchain
  28.  
  29. # update the dependencies
  30. echo ==cargo update==
  31. rustup run --install $toolchain cargo update
  32. echo ==cargo build==
  33. cargo +$toolchain build --release
  34.  
  35. # remove old artifacts, because cargo doesn't do that and folder grows over 10Gb
  36. find $ncspot_dir/target/*/{deps,build} -mindepth 1 -atime +0 -delete
Advertisement
Add Comment
Please, Sign In to add comment