|
22 | 22 | use_travis <- function(browse = interactive()) { |
23 | 23 | check_uses_github() |
24 | 24 |
|
25 | | - use_template( |
| 25 | + new <- use_template( |
26 | 26 | "travis.yml", |
27 | 27 | ".travis.yml", |
28 | 28 | ignore = TRUE |
29 | 29 | ) |
| 30 | + if (!new) return(invisible(FALSE)) |
30 | 31 |
|
31 | 32 | travis_activate(browse) |
32 | 33 | use_travis_badge() |
33 | | - |
34 | 34 | invisible(TRUE) |
35 | 35 | } |
36 | 36 |
|
@@ -81,26 +81,25 @@ use_coverage <- function(type = c("codecov", "coveralls")) { |
81 | 81 |
|
82 | 82 | use_dependency("covr", "Suggests") |
83 | 83 |
|
84 | | - switch(type, |
85 | | - codecov = { |
86 | | - use_template("codecov.yml", ignore = TRUE) |
87 | | - use_codecov_badge() |
88 | | - todo("Add to {value('.travis.yml')}:") |
89 | | - code_block( |
90 | | - "after_success:", |
91 | | - " - Rscript -e 'covr::codecov()'" |
92 | | - ) |
93 | | - }, |
94 | | - |
95 | | - coveralls = { |
96 | | - todo("Turn on coveralls for this repo at https://coveralls.io/repos/new") |
97 | | - use_coveralls_badge() |
98 | | - todo("Add to {value('.travis.yml')}:") |
99 | | - code_block( |
100 | | - "after_success:", |
101 | | - " - Rscript -e 'covr::coveralls()'" |
102 | | - ) |
103 | | - } |
| 84 | + if (type == "codecov") { |
| 85 | + new <- use_template("codecov.yml", ignore = TRUE) |
| 86 | + if (!new) return(invisible(FALSE)) |
| 87 | + } |
| 88 | + |
| 89 | + if (type == "coveralls") { |
| 90 | + todo("Turn on coveralls for this repo at https://coveralls.io/repos/new") |
| 91 | + } |
| 92 | + |
| 93 | + switch( |
| 94 | + type, |
| 95 | + codecov = use_codecov_badge(), |
| 96 | + coveralls = use_coveralls_badge() |
| 97 | + ) |
| 98 | + |
| 99 | + todo("Add to {value('.travis.yml')}:") |
| 100 | + code_block( |
| 101 | + "after_success:", |
| 102 | + " - Rscript -e 'covr::{type}()'" |
104 | 103 | ) |
105 | 104 |
|
106 | 105 | invisible(TRUE) |
@@ -133,7 +132,8 @@ use_coveralls_badge <- function() { |
133 | 132 | use_appveyor <- function(browse = interactive()) { |
134 | 133 | check_uses_github() |
135 | 134 |
|
136 | | - use_template("appveyor.yml", ignore = TRUE) |
| 135 | + new <- use_template("appveyor.yml", ignore = TRUE) |
| 136 | + if (!new) return(invisible(FALSE)) |
137 | 137 |
|
138 | 138 | appveyor_activate(browse) |
139 | 139 | use_appveyor_badge() |
|
0 commit comments