Macros for SAS Application Developers
https://github.com/sasjs/core
Toggle main menu visibility
Home
File List
▼
@sasjs/core
Macro Core
▼
File List
▼
base
mf_abort.sas
mf_dedup.sas
mf_deletefile.sas
mf_existds.sas
mf_existfeature.sas
mf_existfileref.sas
mf_existfunction.sas
mf_existvar.sas
mf_existvarlist.sas
mf_fmtdttm.sas
mf_getapploc.sas
mf_getattrc.sas
mf_getattrn.sas
mf_getengine.sas
mf_getfilesize.sas
mf_getfmtlist.sas
mf_getfmtname.sas
mf_getgitbranch.sas
mf_getkeyvalue.sas
mf_getplatform.sas
mf_getquotedstr.sas
mf_getschema.sas
mf_getuniquefileref.sas
mf_getuniquelibref.sas
mf_getuniquename.sas
mf_getuser.sas
mf_getvalue.sas
mf_getvarcount.sas
mf_getvarformat.sas
mf_getvarlen.sas
mf_getvarlist.sas
mf_getvarnum.sas
mf_getvartype.sas
mf_getxengine.sas
mf_increment.sas
mf_isblank.sas
mf_isdir.sas
mf_isint.sas
mf_islibds.sas
mf_loc.sas
mf_mimetype.sas
mf_mkdir.sas
mf_mval.sas
mf_nobs.sas
mf_readfile.sas
mf_trimstr.sas
mf_uid.sas
mf_verifymacvars.sas
mf_wordsinstr1andstr2.sas
mf_wordsinstr1butnotstr2.sas
mf_writefile.sas
mp_abort.sas
mp_aligndecimal.sas
mp_appendfile.sas
mp_applyformats.sas
mp_assert.sas
mp_assertcols.sas
mp_assertcolvals.sas
mp_assertdsobs.sas
mp_assertscope.sas
mp_base64copy.sas
mp_binarycopy.sas
mp_chop.sas
mp_cleancsv.sas
mp_cntlout.sas
mp_copyfolder.sas
mp_coretable.sas
mp_createconstraints.sas
mp_createwebservice.sas
mp_csv2ds.sas
mp_deleteconstraints.sas
mp_deletefolder.sas
mp_dictionary.sas
mp_dirlist.sas
mp_distinctfmtvalues.sas
mp_dropmembers.sas
mp_ds2cards.sas
mp_ds2csv.sas
mp_ds2ddl.sas
mp_ds2fmtds.sas
mp_ds2inserts.sas
mp_ds2md.sas
mp_ds2squeeze.sas
mp_dsmeta.sas
mp_filtercheck.sas
mp_filtergenerate.sas
mp_filterstore.sas
mp_filtervalidate.sas
mp_getcols.sas
mp_getconstraints.sas
mp_getdbml.sas
mp_getddl.sas
mp_getformats.sas
mp_getmaxvarlengths.sas
mp_getpk.sas
mp_gitadd.sas
mp_gitlog.sas
mp_gitreleaseinfo.sas
mp_gitstatus.sas
mp_gsubfile.sas
mp_guesspk.sas
mp_hashdataset.sas
mp_hashdirectory.sas
mp_include.sas
mp_init.sas
mp_jsonout.sas
mp_lib2cards.sas
mp_lib2inserts.sas
mp_loadformat.sas
mp_lockanytable.sas
mp_lockfilecheck.sas
mp_makedata.sas
mp_md5.sas
mp_perflog.sas
mp_prevobs.sas
mp_recursivejoin.sas
mp_replace.sas
mp_reseterror.sas
mp_resetoption.sas
mp_retainedkey.sas
mp_runddl.sas
mp_searchcols.sas
mp_searchdata.sas
mp_setkeyvalue.sas
mp_sortinplace.sas
mp_stackdiffs.sas
mp_storediffs.sas
mp_stprequests.sas
mp_streamfile.sas
mp_stripdiffs.sas
mp_testjob.sas
mp_testservice.sas
mp_testwritespeedlibrary.sas
mp_tree.sas
mp_unzip.sas
mp_updatevarlength.sas
mp_validatecol.sas
mp_wait4file.sas
mp_webin.sas
mp_zip.sas
►
ddl
►
fcmp
►
lua
►
meta
►
metax
►
server
►
tests
►
viya
►
xplatform
•
All
Files
Pages
Loading...
Searching...
No Matches
mp_gitadd.sas
Go to the documentation of this file.
1
/**
2
@file
3
@brief Stages files in a GIT repo
4
@details Uses the output dataset from mp_gitstatus.sas to determine the files
5
that should be staged.
6
7
If `STAGED ne "TRUE"` then the file is staged.
8
9
Usage:
10
11
%let dir=%sysfunc(pathname(work))/core;
12
%let repo=https://github.com/sasjs/core;
13
%put source clone rc=%sysfunc(GITFN_CLONE(&repo,&dir));
14
%mf_writefile(&dir/somefile.txt,l1=some content)
15
%mf_deletefile(&dir/package.json)
16
%mp_gitstatus(&dir,outds=work.gitstatus)
17
18
%mp_gitadd(&dir,inds=work.gitstatus)
19
20
@param [in] gitdir The directory containing the GIT repository
21
@param [in] inds= (work.mp_gitadd) The input dataset with the list of files
22
to stage. Will accept the output from mp_gitstatus(), else just use a table
23
with the following columns:
24
@li path $1024 - relative path to the file in the repo
25
@li staged $32 - whether the file is staged (TRUE or FALSE)
26
@li status $64 - either new, deleted, or modified
27
28
@param [in] mdebug= (0) Set to 1 to enable DEBUG messages
29
30
<h4> Related Files </h4>
31
@li mp_gitadd.test.sas
32
@li mp_gitstatus.sas
33
34
**/
35
36
%macro mp_gitadd(gitdir,inds=work.mp_gitadd,mdebug=0);
37
38
data _null_;
39
set
&inds;
40
if
STAGED ne
"TRUE"
;
41
rc=git_index_add(
"&gitdir"
,cats(path),status);
42
if
rc ne 0 or &mdebug=1 then put rc=;
43
run;
44
45
%mend mp_gitadd;
base
mp_gitadd.sas
Generated by
1.13.2
For more information visit the
Macro Core library
.