Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_gitadd.sas File Reference

Stages files in a GIT repo. More...

Go to the source code of this file.

Detailed Description

Uses the output dataset from mp_gitstatus.sas to determine the files that should be staged.

If STAGED ne "TRUE" then the file is staged.

Usage:

%let dir=%sysfunc(pathname(work))/core;
%let repo=https://github.com/sasjs/core;
%put source clone rc=%sysfunc(GITFN_CLONE(&repo,&dir));
%mf_writefile(&dir/somefile.txt,l1=some content)
%mf_deletefile(&dir/package.json)
%mp_gitstatus(&dir,outds=work.gitstatus)

%mp_gitadd(&dir,inds=work.gitstatus)
Parameters
[in]gitdirThe directory containing the GIT repository
[in]inds=(work.mp_gitadd) The input dataset with the list of files to stage. Will accept the output from mp_gitstatus(), else just use a table with the following columns:
  • path $1024 - relative path to the file in the repo
  • staged $32 - whether the file is staged (TRUE or FALSE)
  • status $64 - either new, deleted, or modified
[in]mdebug=(0) Set to 1 to enable DEBUG messages

Related Files

Definition in file mp_gitadd.sas.