-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
107 lines (89 loc) · 2.14 KB
/
README.Rmd
File metadata and controls
107 lines (89 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
title: bash-aux
output:
github_document
---
```{r, echo=FALSE,include=FALSE}
# Make sure colors from tput are used correctly in the output
options(crayon.enabled = TRUE)
knitr::knit_hooks$set(output = function(x, options) {
paste0(
# "<svg fill=\"none\" viewBox=\"0 0 600 300\" width=\"600\" height=\"300\" xmlns=\"http://www.w3.org/2000/svg\">",
# "<foreignObject width=\"100%\" height=\"100%\">",
'<pre class="r-output">',
paste0(
"<code>",
paste0(
fansi::to_html(
x =
htmltools::htmlEscape(x),
warn = FALSE,
carry = FALSE
),
collapse = " \n"
),
"</code>",
collapse = "\n"
),
"</pre>"
# "</foreignObject>",
# "</svg>"
)
})
num_colors <- function(forget = TRUE) 256
library(crayon)
assignInNamespace("num_colors", num_colors, pos = "package:crayon")
Sys.setenv("TERM" = "dumb")
print_help <-
function(x) {
cat(
system(
paste0(
"/usr/bin/env bash -c \"source ./bash-aux-init && ",
x,
" --help\""
),
intern = TRUE),
sep =
"\n"
)
}
```
Collection of helpful functions for [bash](https://www.gnu.org/software/bash/).
Core functions are outlined below.
# Core functions
## Dependency checks
### check_dependencies
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("check_dependencies")
```
### check_dependency
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("check_dependency")
```
## Folders & Files
### current_file
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("current_file")
```
### make_file_path
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("make_file_path")
```
### normalize_path
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("normalize_path")
```
### read_from_file
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("read_from_file")
```
## Logging
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("bash_aux_log")
```
## Misc
### read_non_blocking
```{r, eval=TRUE, echo=FALSE,include=TRUE,comment=""}
print_help("read_non_blocking")
```