From ecf56d95784699a85a2936a76f7ac48000e3a524 Mon Sep 17 00:00:00 2001 From: Kfir Kaplan Date: Thu, 2 Mar 2023 20:47:24 +0200 Subject: [PATCH 1/2] Added make update This is to make sure that users remember to recompile after making pulling from github. --- Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Makefile b/Makefile index affe0216f6..2b904c2cd8 100644 --- a/Makefile +++ b/Makefile @@ -145,6 +145,29 @@ scoop: all @ echo "Running minimal example with SCOOP" python -m scoop -n 2 rmg.py -v testing/scoop/input.py +.ONESHELL: +update: + @ echo "Updating RMG-py" + @ echo "Please remember to stash unwanted changes." + git status + @ read -p "Are there any changes that are not staged for committed? [y|n] " user_input + if [ "$$user_input" = "N" ] || [ "$$user_input" = "n" ]; then + git checkout main || true + git pull git@github.com:ReactionMechanismGenerator/RMG-Py.git main || git pull https://github.com/ReactionMechanismGenerator/RMG-Py.git main || true + conda activate rmg_env + make + conda deactivate + exit + elif [ "$$user_input" = "Y" ] || [ "$$user_input" = "y" ]; then + @ echo "Please stash using 'git stash' and run this again" + @ echo "After the operation is done, use 'git stash pop'" + @ echo "Aborting..." + exit + fi + @ echo Wrong input: $$user_input + @ echo "Aborting..." + exit + ######### # Section for setting up MOPAC calculations on the Travis-CI.org server ifeq ($(TRAVIS),true) From 402abd1610455b184529b322f98d5d83e1ab1e89 Mon Sep 17 00:00:00 2001 From: Kfir Kaplan Date: Thu, 2 Mar 2023 20:56:11 +0200 Subject: [PATCH 2/2] added automatic update to docs --- .../source/users/rmg/installation/updatingSourceCode.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/documentation/source/users/rmg/installation/updatingSourceCode.rst b/documentation/source/users/rmg/installation/updatingSourceCode.rst index 0ac84e0835..1972920547 100644 --- a/documentation/source/users/rmg/installation/updatingSourceCode.rst +++ b/documentation/source/users/rmg/installation/updatingSourceCode.rst @@ -7,7 +7,14 @@ Updating the RMG-Py Source Code It is recommended to keep yourself up to date with the latest patches and bug fixes by RMG developers, which is maintained on the official repository at https://github.com/ReactionMechanismGenerator/RMG-Py/ You can view the latest changes by viewing the commits tab on the repository. -To update your source code, you can "pull" the latest changes from the official repo by typing the following command in the + +To update your local RMG-Py source code automatically, you can use the following commands:: + + cd /path/to/RMG-Py + conda activate rmg_env + make update + +To update your source code manually, you can "pull" the latest changes from the official repo by typing the following command in the Command Prompt :: cd RMG-Py