ThinkR-open / golem
Showing 1 of 1 files from the diff.

@@ -21,6 +21,11 @@
Loading
21 21
  
22 22
  old <- setwd(path_abs(pkg))  
23 23
  on.exit(setwd(old))
24 +
  
25 +
  if (missing(name)){
26 +
    name <- basename(url)
27 +
  }
28 +
  
24 29
  name <-  file_path_sans_ext(name)
25 30
  new_file <- sprintf( "%s.js", name )
26 31
  
@@ -41,6 +46,18 @@
Loading
41 46
    dir, new_file
42 47
  )
43 48
  
49 +
  if (
50 +
    fs::file_exists(where)
51 +
  ){
52 +
    cat_red_bullet(
53 +
      sprintf(
54 +
        "A file named `%s` already exists in %s. You need to delete or rename this file first.",
55 +
        new_file, dir
56 +
      )
57 +
    )
58 +
    return(invisible(FALSE))
59 +
  }
60 +
  
44 61
  if ( file_ext(url) != "js") {
45 62
    cat_red_bullet(
46 63
      "File not added (URL must end with .js extension)"
@@ -78,6 +95,11 @@
Loading
78 95
  
79 96
  old <- setwd(path_abs(pkg))  
80 97
  on.exit(setwd(old))
98 +
  
99 +
  if (missing(name)){
100 +
    name <- basename(url)
101 +
  }
102 +
  
81 103
  name <-  file_path_sans_ext(name)
82 104
  new_file <- sprintf("%s.css", name)
83 105
  
@@ -98,6 +120,18 @@
Loading
98 120
    dir, new_file
99 121
  )
100 122
  
123 +
  if (
124 +
    fs::file_exists(where)
125 +
  ){
126 +
    cat_red_bullet(
127 +
      sprintf(
128 +
        "A file named `%s` already exists in %s. You need to delete or rename this file first.",
129 +
        new_file, dir
130 +
      )
131 +
    )
132 +
    return(invisible(FALSE))
133 +
  }
134 +
  
101 135
  if ( file_ext(url) != "css") {
102 136
    cat_red_bullet(
103 137
      "File not added (URL must end with .css extension)"
@@ -158,6 +192,18 @@
Loading
158 192
    dir, new_file
159 193
  )
160 194
  
195 +
  if (
196 +
    fs::file_exists(where)
197 +
  ){
198 +
    cat_red_bullet(
199 +
      sprintf(
200 +
        "A file named `%s` already exists in %s. You need to delete or rename this file first.",
201 +
        new_file, dir
202 +
      )
203 +
    )
204 +
    return(invisible(FALSE))
205 +
  }
206 +
  
161 207
  cat_line("")
162 208
  cat_rule("Initiating file download")
163 209
  
@@ -185,7 +231,6 @@
Loading
185 231
  dir_create = TRUE
186 232
){
187 233
  
188 -
  
189 234
  if (missing(name)){
190 235
    name <- basename(url)
191 236
  }
@@ -210,6 +255,18 @@
Loading
210 255
    dir, name
211 256
  )
212 257
  
258 +
  if (
259 +
    fs::file_exists(where)
260 +
  ){
261 +
    cat_red_bullet(
262 +
      sprintf(
263 +
        "A file named `%s` already exists in %s. You need to delete or rename this file first.",
264 +
        new_file, dir
265 +
      )
266 +
    )
267 +
    return(invisible(FALSE))
268 +
  }
269 +
  
213 270
  cat_line("")
214 271
  cat_rule("Initiating file download")
215 272
  
Files Coverage
R 66.71%
Project Totals (28 files) 66.71%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading