mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 21:26:11 +01:00
website
This commit is contained in:
parent
ba255ddb00
commit
8dcf101a9c
12
.github/prehooks/pre-commit
vendored
12
.github/prehooks/pre-commit
vendored
@ -36,8 +36,8 @@ if command -v Rscript > /dev/null; then
|
|||||||
if [ "$(Rscript -e 'cat(all(c('"'pkgload'"', '"'devtools'"', '"'dplyr'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then
|
if [ "$(Rscript -e 'cat(all(c('"'pkgload'"', '"'devtools'"', '"'dplyr'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then
|
||||||
Rscript -e "source('data-raw/_pre_commit_hook.R')"
|
Rscript -e "source('data-raw/_pre_commit_hook.R')"
|
||||||
currentpkg=$(Rscript -e "cat(pkgload::pkg_name())")
|
currentpkg=$(Rscript -e "cat(pkgload::pkg_name())")
|
||||||
echo "-> Adding files in 'data-raw' and 'man' to this commit"
|
echo "- Adding changed files in ./data-raw and ./man to this commit"
|
||||||
git add data-raw/*
|
git add data-raw/* --quiet
|
||||||
git add man/*
|
git add man/*
|
||||||
git add R/sysdata.rda
|
git add R/sysdata.rda
|
||||||
git add NAMESPACE
|
git add NAMESPACE
|
||||||
@ -65,7 +65,7 @@ if [ "$currenttag" = "" ]; then
|
|||||||
# there is no tag, so set tag to 0.0.1 and commit index to current count
|
# there is no tag, so set tag to 0.0.1 and commit index to current count
|
||||||
currenttag="0.0.1"
|
currenttag="0.0.1"
|
||||||
currentcommit=$(git rev-list --count ${defaultbranch})
|
currentcommit=$(git rev-list --count ${defaultbranch})
|
||||||
echo "- no git tags found, create one in format 'v(x).(y).(z)' - curently ${currentcommit} previous commits in ${defaultbranch}"
|
echo "- no git tags found, create one in format 'v(x).(y).(z)' - curently ${currentcommit} previous commits in '${defaultbranch}'"
|
||||||
else
|
else
|
||||||
# there is a tag, so base version number on that
|
# there is a tag, so base version number on that
|
||||||
currentcommit=$(git rev-list --count ${currenttagfull}..${defaultbranch})
|
currentcommit=$(git rev-list --count ${currenttagfull}..${defaultbranch})
|
||||||
@ -73,7 +73,7 @@ else
|
|||||||
# tag is new, so this must become the version number
|
# tag is new, so this must become the version number
|
||||||
currentversion="$currenttag"
|
currentversion="$currenttag"
|
||||||
fi
|
fi
|
||||||
echo "- latest tag is '${currenttagfull}', with ${currentcommit} previous commits in ${defaultbranch}"
|
echo "- latest tag is '${currenttagfull}', with ${currentcommit} previous commits in '${defaultbranch}'"
|
||||||
fi
|
fi
|
||||||
if [ "$currentversion" = "" ]; then
|
if [ "$currentversion" = "" ]; then
|
||||||
# combine tag (e.g. 1.2.3) and commit number (like 5) increased by 9000 to indicate beta version
|
# combine tag (e.g. 1.2.3) and commit number (like 5) increased by 9000 to indicate beta version
|
||||||
@ -84,7 +84,7 @@ echo "- ${currentpkg} pkg version set to ${currentversion}"
|
|||||||
# set version number and date to DESCRIPTION file
|
# set version number and date to DESCRIPTION file
|
||||||
sed -i -- "s/^Version: .*/Version: ${currentversion}/" DESCRIPTION
|
sed -i -- "s/^Version: .*/Version: ${currentversion}/" DESCRIPTION
|
||||||
sed -i -- "s/^Date: .*/Date: $(date '+%Y-%m-%d')/" DESCRIPTION
|
sed -i -- "s/^Date: .*/Date: $(date '+%Y-%m-%d')/" DESCRIPTION
|
||||||
echo "- updated DESCRIPTION"
|
echo "- updated version number and date in ./DESCRIPTION"
|
||||||
# remove leftover on macOS
|
# remove leftover on macOS
|
||||||
rm -f DESCRIPTION--
|
rm -f DESCRIPTION--
|
||||||
# add to commit
|
# add to commit
|
||||||
@ -96,7 +96,7 @@ if [ -e "NEWS.md" ]; then
|
|||||||
currentpkg=""
|
currentpkg=""
|
||||||
fi
|
fi
|
||||||
sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md
|
sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md
|
||||||
echo "- updated NEWS.md"
|
echo "- updated version number in ./NEWS.md"
|
||||||
# remove leftover on macOS
|
# remove leftover on macOS
|
||||||
rm -f NEWS.md--
|
rm -f NEWS.md--
|
||||||
# add to commit
|
# add to commit
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 1.8.2.9134
|
Version: 1.8.2.9135
|
||||||
Date: 2023-02-18
|
Date: 2023-02-18
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
|||||||
# AMR 1.8.2.9134
|
# AMR 1.8.2.9135
|
||||||
|
|
||||||
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
||||||
|
|
||||||
|
@ -1139,7 +1139,7 @@ try_colour <- function(..., before, after, collapse = " ") {
|
|||||||
}
|
}
|
||||||
is_dark <- function() {
|
is_dark <- function() {
|
||||||
if (is.null(AMR_env$is_dark_theme)) {
|
if (is.null(AMR_env$is_dark_theme)) {
|
||||||
!has_colour() || AMR_env$is_dark_theme <- tryCatch(isTRUE(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$dark), error = function(e) FALSE)
|
AMR_env$is_dark_theme <- !has_colour() || tryCatch(isTRUE(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$dark), error = function(e) FALSE)
|
||||||
}
|
}
|
||||||
isTRUE(AMR_env$is_dark_theme)
|
isTRUE(AMR_env$is_dark_theme)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user