From 268a9a64126d3ef60640ca629285e198fcab06b2 Mon Sep 17 00:00:00 2001 From: timelyportfolio Date: Wed, 24 Dec 2014 13:07:02 -0600 Subject: [PATCH] fix issue #53 for non-windows with scaffold --- R/scaffold.R | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/R/scaffold.R b/R/scaffold.R index 5793d7cf..3096993b 100644 --- a/R/scaffold.R +++ b/R/scaffold.R @@ -185,15 +185,16 @@ installBowerPkg <- function(pkg){ findBower <- function(){ # a slightly more robust finder of bower for windows # which does not require PATH environment variable to be set - bowerPath = if(Sys.which("bower") == "") { + + # try to find the easy case + bowerPath = Sys.which("bower") + + if(bowerPath == "" && identical(.Platform$OS.type,"windows")) { # if it does not find Sys.which('bower') - # also check APPDATA to see if found there - if(identical(.Platform$OS.type,"windows")) { - Sys.which(file.path(Sys.getenv("APPDATA"),"npm","bower.")) - } - } else { - Sys.which("bower") + # also check APPDATA if Windows to see if found there + bowerPath = Sys.which(file.path(Sys.getenv("APPDATA"),"npm","bower.")) } + return(bowerPath) }