浏览代码

[style] Expand terse/inlined conditionals.

Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
Fletcher Nichol 6 年之前
父节点
当前提交
035bcdadab
共有 1 个文件被更改,包括 13 次插入3 次删除
  1. 13 3
      renv.sh

+ 13 - 3
renv.sh

@@ -13,9 +13,19 @@ renv() {
         return 3
       fi
 
-      [[ -n "$RENV_ORIG_GEM_HOME" ]] && GEM_HOME=$RENV_ORIG_GEM_HOME || unset GEM_HOME
-      [[ -n "$RENV_ORIG_GEM_PATH" ]] && GEM_PATH=$RENV_ORIG_GEM_PATH || unset GEM_PATH
-      [[ -n "$RENV_ORIG_PATH" ]] && PATH=$RENV_ORIG_PATH
+      if [[ -n "$RENV_ORIG_GEM_HOME" ]]; then
+        GEM_HOME=$RENV_ORIG_GEM_HOME
+      else
+        unset GEM_HOME
+      fi
+      if [[ -n "$RENV_ORIG_GEM_PATH" ]]; then
+        GEM_PATH=$RENV_ORIG_GEM_PATH
+      else
+        unset GEM_PATH
+      fi
+      if [[ -n "$RENV_ORIG_PATH" ]]; then
+        PATH=$RENV_ORIG_PATH
+      fi
       unset RENV_ORIG_GEM_HOME RENV_ORIG_GEM_PATH RENV_ORIG_PATH
 
       echo "---> renv is reset, GEM_HOME is ${GEM_HOME:-<unset>}"