Skip to content

Commit

Permalink
Cs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed May 17, 2021
1 parent 96db9da commit 4d26565
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
16 changes: 0 additions & 16 deletions tasks/get_list_packages.yml

This file was deleted.

19 changes: 16 additions & 3 deletions tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,22 @@
tags:
- r-packages-copy-r-scripts

- name: packages | init the package lists
include: get_list_packages.yml
when: r_list_packages_once
- block:

- name: packages | list installed packages
command: >
R-list-installed-packages {{ r_packages_lib }}
environment: "{{ r_environment }}"
register: _r_installed_packages
changed_when: false

- name: packages | set_fact list installed packages
set_fact:
r_installed_packages: "{{ _r_installed_packages.stdout_lines }}"

when: r_list_packages_once | bool
tags:
- r-packages-list-installed

- name: packages | install
command: >
Expand Down
4 changes: 2 additions & 2 deletions templates/R-install-package.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (type == 'github') {
package = argv[1];
}

{% if r_list_packages_once == false %}
{% if not r_list_packages_once %}
if (!(package %in% installed.packages(lib.loc = lib)[, 'Package'])) {
{% endif %}
if (type == 'cran') {
Expand Down Expand Up @@ -54,6 +54,6 @@ if (!(package %in% installed.packages(lib.loc = lib)[, 'Package'])) {
cat("Unrecognised type\n");
q(status = 1);
}
{% if r_list_packages_once == false %}
{% if not r_list_packages_once %}
}
{% endif %}
1 change: 0 additions & 1 deletion templates/R-list-installed-packages.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ if (is.null(argv) | length(argv) < 1) {
lib = ifelse(is.na(argv[1]), '{{ r_packages_lib }}', argv[1]);

cat(paste(installed.packages(lib.loc = lib)[, 'Package'], collapse="\n"))

0 comments on commit 4d26565

Please sign in to comment.