From c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4 Mon Sep 17 00:00:00 2001 From: Felix Cheung Date: Mon, 16 Jan 2017 13:49:12 -0800 Subject: [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 Closes #16249 from felixcheung/rscripts. --- R/install-dev.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'R/install-dev.sh') 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/ -- cgit v1.2.3