2020-01-05 17:22:09 +01:00
|
|
|
# ==================================================================== #
|
|
|
|
# TITLE #
|
2020-10-08 11:16:03 +02:00
|
|
|
# Antimicrobial Resistance (AMR) Analysis for R #
|
2020-01-05 17:22:09 +01:00
|
|
|
# #
|
|
|
|
# SOURCE #
|
2020-07-08 14:48:06 +02:00
|
|
|
# https://github.com/msberends/AMR #
|
2020-01-05 17:22:09 +01:00
|
|
|
# #
|
|
|
|
# LICENCE #
|
2020-12-27 00:30:28 +01:00
|
|
|
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
2020-10-08 11:16:03 +02:00
|
|
|
# Developed at the University of Groningen, the Netherlands, in #
|
|
|
|
# collaboration with non-profit organisations Certe Medical #
|
|
|
|
# Diagnostics & Advice, and University Medical Center Groningen. #
|
2020-01-05 17:22:09 +01:00
|
|
|
# #
|
|
|
|
# This R package is free software; you can freely use and distribute #
|
|
|
|
# it for both personal and commercial purposes under the terms of the #
|
|
|
|
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
|
|
|
# the Free Software Foundation. #
|
|
|
|
# We created this package for both routine data analysis and academic #
|
|
|
|
# research and it was publicly released in the hope that it will be #
|
|
|
|
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
2020-10-08 11:16:03 +02:00
|
|
|
# #
|
|
|
|
# Visit our website for the full manual and a complete tutorial about #
|
|
|
|
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
2020-01-05 17:22:09 +01:00
|
|
|
# ==================================================================== #
|
|
|
|
|
2020-04-17 19:16:30 +02:00
|
|
|
########################################################################
|
|
|
|
# `git_premaster.sh` takes 3 parameters: #
|
|
|
|
# 1. Commit message (character) [mandatory] #
|
2020-07-08 14:48:06 +02:00
|
|
|
# 2. Lazy website generation (logical), with TRUE only changed #
|
2020-04-17 19:16:30 +02:00
|
|
|
# files will be processed [defaults to TRUE] #
|
|
|
|
# 3. Version number to be used in DESCRIPTION and NEWS.md #
|
|
|
|
# [defaults to current tag and last commit number + 9000] #
|
|
|
|
# #
|
|
|
|
# To push new commits to the premaster branch, run: #
|
|
|
|
# bash git_premaster.sh "commit message" #
|
|
|
|
# This creates auto version numbering in DESCRIPTION and NEWS.md. #
|
|
|
|
# #
|
|
|
|
# After successful test checks, merge it to the master branch with: #
|
|
|
|
# bash git_merge.sh #
|
|
|
|
# #
|
|
|
|
# To prerelease a new version number, run: #
|
|
|
|
# bash git_premaster.sh "v1.x.x" FALSE "1.x.x" #
|
|
|
|
# #
|
|
|
|
# To only update the website, run: #
|
|
|
|
# bash git_siteonly.sh #
|
|
|
|
# (which is short for 'bash git_premaster.sh "website update" FALSE') #
|
|
|
|
########################################################################
|
2019-05-20 14:16:53 +02:00
|
|
|
|
|
|
|
# stash current changes
|
|
|
|
# git stash --quiet
|
|
|
|
|
|
|
|
# go to master
|
|
|
|
git checkout master --quiet
|
2019-06-16 21:42:40 +02:00
|
|
|
echo "• changed branch to master"
|
2019-08-08 22:39:42 +02:00
|
|
|
|
2019-05-20 14:16:53 +02:00
|
|
|
# import everything from premaster
|
2019-06-01 20:40:49 +02:00
|
|
|
git merge premaster --quiet
|
2019-05-20 14:16:53 +02:00
|
|
|
# and send it to git
|
2019-06-01 20:40:49 +02:00
|
|
|
git push --quiet
|
2019-06-16 21:42:40 +02:00
|
|
|
echo "• pushed changes to master"
|
2019-08-08 22:39:42 +02:00
|
|
|
|
2019-05-20 14:16:53 +02:00
|
|
|
# return to premaster
|
|
|
|
git checkout premaster --quiet
|
2019-06-16 21:42:40 +02:00
|
|
|
echo "• changed branch back to premaster"
|
2019-06-01 20:40:49 +02:00
|
|
|
git status --short
|
2019-10-07 15:12:42 +02:00
|
|
|
echo
|
2019-06-01 20:40:49 +02:00
|
|
|
|
2019-10-07 15:12:42 +02:00
|
|
|
read -p "Use R-hub to simulate all CRAN checks (y/N)? " choice
|
|
|
|
case "$choice" in
|
|
|
|
y|Y|j|J ) ;;
|
|
|
|
* ) exit 1;;
|
|
|
|
esac
|
2020-04-17 19:16:30 +02:00
|
|
|
Rscript -e "rhub::check(devtools::build(), platform = rhub::platforms()[!is.na(rhub::platforms()$`cran-name`), 'name'])"
|
2019-10-07 15:12:42 +02:00
|
|
|
echo
|
2019-05-20 14:16:53 +02:00
|
|
|
|
|
|
|
# and get stashed changes back
|
|
|
|
# git stash apply --quiet
|
|
|
|
|