-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate_packages.sh
65 lines (63 loc) · 1.84 KB
/
update_packages.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
set -e
# Init environment
source "$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/scripts/utils.sh" && init_setup
# Set environment variables
N_CPUS=${N_CPUS:-8}
case "$1" in
"systools")
brew upgrade && brew cleanup
;;
"omz"|"oh-my-zsh")
zsh -ic "upgrade_oh_my_zsh_all"
;;
"pyenv")
uv pip install -r ${SCRIPT_ROOT_PREFIX}/misc/pyproject.toml -U --extra full
uv cache clean
;;
"pyenv-dryrun")
uv pip install -r ${SCRIPT_ROOT_PREFIX}/misc/pyproject.toml -U --dry-run --extra full
;;
"renv")
Rscript -e "
options(Ncpus=${N_CPUS})
old_pkgs <- old.packages(lib.loc=Sys.getenv('R_LIBS'), repos=Sys.getenv('CRAN'))
if (!is.null(old_pkgs)) {
pak::meta_update();
pak::pkg_install(rownames(old_pkgs), lib=\"${R_LIBS}\", upgrade=TRUE);
pak::cache_clean()
} else {
cat('No package needs to be updated.\n');
}
"
;;
"renv-dryrun")
Rscript -e "
old_pkgs <- old.packages(lib.loc=Sys.getenv('R_LIBS'), repos=Sys.getenv('CRAN'))
if (!is.null(old_pkgs)) {
print(old_pkgs)
} else {
cat('No package needs to be updated.\n');
}
"
;;
"texlive")
tlmgr update --self --all
;;
"fsl")
update_fsl_release
;;
"fsleyes")
micromamba update fsleyes -p "$(eval "echo ${INSTALL_ROOT_PREFIX}/fsleyes/env")" -c conda-forge
;;
"ants")
micromamba update ants -p "$(eval "echo ${INSTALL_ROOT_PREFIX}/ants/env")" -c conda-forge
;;
"dcm2niix")
micromamba update dcm2niix -p "$(eval "echo ${INSTALL_ROOT_PREFIX}/dcm2niix/env")" -c conda-forge
;;
*)
echo "Invalid installation option."
exit 1
;;
esac