-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun CellMorphR.command
More file actions
executable file
·18 lines (18 loc) · 1.02 KB
/
Copy pathRun CellMorphR.command
File metadata and controls
executable file
·18 lines (18 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# Launch this R/Shiny app locally; it opens in your web browser. Double-click me.
cd "$(dirname "$0")"
RS=""
[ -n "$R_RSCRIPT" ] && [ -x "$R_RSCRIPT" ] && RS="$R_RSCRIPT"
[ -z "$RS" ] && command -v Rscript >/dev/null 2>&1 && RS="$(command -v Rscript)"
[ -z "$RS" ] && [ -x /Library/Frameworks/R.framework/Resources/bin/Rscript ] && RS=/Library/Frameworks/R.framework/Resources/bin/Rscript
for C in "$HOME/miniconda3" "$HOME/anaconda3" "$HOME/miniforge3" "$HOME/mambaforge" /opt/miniconda3 /opt/anaconda3 /opt/homebrew/Caskroom/miniforge/base; do
[ -z "$RS" ] && [ -x "$C/bin/Rscript" ] && RS="$C/bin/Rscript"
[ -z "$RS" ] && [ -x "$C/envs/r/bin/Rscript" ] && RS="$C/envs/r/bin/Rscript"
done
if [ -z "$RS" ]; then
echo "Could not find R (Rscript). Install R from https://cran.r-project.org/,"
echo "or set R_RSCRIPT to your Rscript (e.g. inside a conda env) and re-run."
read -r -p "Press Enter to close..." _ ; exit 1
fi
echo "Starting — a browser window will open shortly. (First run installs R packages.)"
"$RS" run_app.R