diff --git a/README.md b/README.md index ddb5ef01..5a008fdc 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ - [checkCFG](#checkcfg) - [CFG content](#cfg-content) - [How to install](#how-to-install) - - [Use the matlab package manager](#use-the-matlab-package-manager) + - [Download with git](#download-with-git) + - [Add as a submodule](#add-as-a-submodule) + - [Direct download](#direct-download) - [Contributing](#contributing) - [Guidestyle](#guidestyle) - [BIDS naming convention](#bids-naming-convention) @@ -281,49 +283,74 @@ cfg.fileName.datasetDescription ## How to install -### Use the matlab package manager +### Download with git -This repository can be added as a dependencies by listing it in a -[mpm-requirements.txt file](.mpm-requirements.txt) as follows: +``` bash +cd fullpath_to_directory_where_to_install +# use git to download the code +git clone https://github.com/cpp-lln-lab/CPP_BIDS.git +# move into the folder you have just created +cd CPP_PTB +# add the src folder to the matlab path and save the path +matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src')); savepath ();" +``` +Then get the latest commit: +```bash +# from the directory where you downloaded the code +git pull origin master ``` -CPP_BIDS -u https://github.com/cpp-lln-lab/CPP_BIDS.git + +To work with a specific version, create a branch at a specific version tag number +```bash +# creating and checking out a branch that will be called version1 at the version tag v0.0.1 +git checkout -b version1 v0.0.1 ``` -You can then use the [matlab package manager](https://github.com/mobeets/mpm), to simply download -the appropriate version of those dependencies and add them to your path by running a -`getDependencies` function like the one below where you just need to replace -`YOUR_EXPERIMENT_NAME` by the name of your experiment. +### Add as a submodule -```matlab -function getDependencies(action) -% Will install on your computer the matlab dependencies specified in the mpm-requirements.txt -% and add them to the matlab path. The path is never saved so you need to run getDependencies() when -% you start matlab. -% -% getDependencies('update') will force the update and overwrite previous version of the dependencies. -% -% getDependencies() If you only already have the appropriate version but just want to add them to the matlab path. - -experimentName = YOUR_EXPERIMENT_NAME; - -if nargin<1 - action = ''; -end - -switch action - case 'update' - % install dependencies - mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME -end - -% adds them to the path -mpm_folder = fileparts(which('mpm')); -addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName))); - -end +Add it as a submodule in the repo you are working on. + +``` bash +cd fullpath_to_directory_where_to_install +# use git to download the code +git submodule add https://github.com/cpp-lln-lab/CPP_BIDS.git +# move into the folder you have just created +cd CPP_PTB +# add the src folder to the matlab path and save the path +matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src'))" ``` +To get the latest commit you then need to update the submodule with the information +on its remote repository and then merge those locally. +```bash +git submodule update --remote --merge +``` + +Remember that updates to submodules need to be commited as well. + +**TO DO** + + +### Direct download + +Download the code. Unzip. And add to the matlab path. + +Pick a specific version: + +https://github.com/cpp-lln-lab/CPP_BIDS/releases + +Or take the latest commit (NOT RECOMMENDED): + +https://github.com/cpp-lln-lab/CPP_BIDS/archive/master.zip + +**TO DO** + + ## Contributing Feel free to open issues to report a bug and ask for improvements.