We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e16a25d commit 39fe156Copy full SHA for 39fe156
tools/scripts/check_rscript
@@ -0,0 +1,33 @@
1
+#!/usr/bin/env bash
2
+#
3
+# Check whether Rscript is installed.
4
5
+# Usage: check_rscript
6
7
+
8
+# VARIABLES #
9
10
+# Find Rscript:
11
+RSCRIPT=$(command -v rscript 2>/dev/null)
12
13
14
+# FUNCTIONS #
15
16
+# Prints usage information.
17
+usage() {
18
+ echo '' >&2
19
+ echo 'Usage: check_rscript' >&2
20
21
+}
22
23
+# MAIN #
24
25
+if [[ -x "${RSCRIPT}" ]] && "${RSCRIPT}" --version >/dev/null; then
26
+ echo 'Rscript is installed.' >&2
27
+ exit 0
28
+else
29
+ echo 'ERROR: missing dependency. Please download R version >= 3.3.3 (https://www.r-project.org/). Once installed, run the command again.' >&2
30
+ exit 1
31
+fi
32
33
+# TODO: check for minimum version
0 commit comments