diff options
author | Felix Cheung <felixcheung_m@hotmail.com> | 2017-01-16 13:49:12 -0800 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2017-01-16 13:49:12 -0800 |
commit | c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4 (patch) | |
tree | f5988031c266dfadaa4a791b07b0737cb39ab529 /R/install-dev.sh | |
parent | a115a54399cd4bedb1a5086943a88af6339fbe85 (diff) | |
download | spark-c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4.tar.gz spark-c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4.tar.bz2 spark-c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4.zip |
[SPARK-18828][SPARKR] Refactor scripts for R
## What changes were proposed in this pull request?
Refactored script to remove duplications and clearer purpose for each script
## How was this patch tested?
manually
Author: Felix Cheung <felixcheung_m@hotmail.com>
Closes #16249 from felixcheung/rscripts.
Diffstat (limited to 'R/install-dev.sh')
-rwxr-xr-x | R/install-dev.sh | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/R/install-dev.sh b/R/install-dev.sh index 0f881208bc..45e6411705 100755 --- a/R/install-dev.sh +++ b/R/install-dev.sh @@ -29,27 +29,15 @@ set -o pipefail set -e -FWDIR="$(cd `dirname $0`; pwd)" +FWDIR="$(cd `dirname "${BASH_SOURCE[0]}"`; pwd)" LIB_DIR="$FWDIR/lib" mkdir -p $LIB_DIR pushd $FWDIR > /dev/null -if [ ! -z "$R_HOME" ] - then - R_SCRIPT_PATH="$R_HOME/bin" - else - # if system wide R_HOME is not found, then exit - if [ ! `command -v R` ]; then - echo "Cannot find 'R_HOME'. Please specify 'R_HOME' or make sure R is properly installed." - exit 1 - fi - R_SCRIPT_PATH="$(dirname $(which R))" -fi -echo "Using R_SCRIPT_PATH = ${R_SCRIPT_PATH}" - -# Generate Rd files if devtools is installed -"$R_SCRIPT_PATH/"Rscript -e ' if("devtools" %in% rownames(installed.packages())) { library(devtools); devtools::document(pkg="./pkg", roclets=c("rd")) }' +. $FWDIR/find-r.sh + +. $FWDIR/create-rd.sh # Install SparkR to $LIB_DIR "$R_SCRIPT_PATH/"R CMD INSTALL --library=$LIB_DIR $FWDIR/pkg/ |