mirror of
https://github.com/sasjs/core.git
synced 2025-12-11 06:24:35 +00:00
Merge pull request #37 from sasjs/createfolderfix
fix: addressed issue when creating recursive folers in mv_createfolde…
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- init: npm i -g @sasjs/cli
|
- init: nvm install --latest-npm && npm i -g @sasjs/cli
|
||||||
|
|
||||||
image:
|
image:
|
||||||
file: .gitpod.dockerfile
|
file: .gitpod.dockerfile
|
||||||
|
|||||||
32
tests/viya/mv_createfolder.test.sas
Normal file
32
tests/viya/mv_createfolder.test.sas
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
@file
|
||||||
|
@brief Testing mv_createfolder macro
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mf_uid.sas
|
||||||
|
@li mp_assert.sas
|
||||||
|
@li mv_createfolder.sas
|
||||||
|
@li mv_deleteviyafolder.sas
|
||||||
|
@li mv_getfoldermembers.sas
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
%let folder=%mf_uid();
|
||||||
|
|
||||||
|
/* create a folder */
|
||||||
|
%mv_createfolder(path=&mcTestAppLoc/temp/&folder/&folder)
|
||||||
|
|
||||||
|
%mv_getfoldermembers(root=&mcTestAppLoc/temp/&folder, outds=work.folders)
|
||||||
|
|
||||||
|
%let test=0;
|
||||||
|
data _null_;
|
||||||
|
set work.folders;
|
||||||
|
putlog (_all_)(=);
|
||||||
|
if name="&folder" then call symputx('test',1);
|
||||||
|
run;
|
||||||
|
|
||||||
|
%mp_assert(
|
||||||
|
iftrue=(&test=1),
|
||||||
|
desc=Check if temp folder can be successfully created
|
||||||
|
)
|
||||||
@@ -96,7 +96,7 @@ options noquotelenmax;
|
|||||||
data _null_;
|
data _null_;
|
||||||
set &libref1..links;
|
set &libref1..links;
|
||||||
if rel='createChild' then
|
if rel='createChild' then
|
||||||
call symputx('href',quote("&base_uri"!!trim(href)),'l');
|
call symputx('href',quote(cats("&base_uri",href)),'l');
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &SYS_PROCHTTP_STATUS_CODE=404 %then %do;
|
%else %if &SYS_PROCHTTP_STATUS_CODE=404 %then %do;
|
||||||
@@ -141,7 +141,7 @@ options noquotelenmax;
|
|||||||
data _null_;
|
data _null_;
|
||||||
set &libref2..links;
|
set &libref2..links;
|
||||||
if rel='createChild' then
|
if rel='createChild' then
|
||||||
call symputx('href',quote(trim(href)),'l');
|
call symputx('href',quote(cats("&base_uri",href)),'l');
|
||||||
run;
|
run;
|
||||||
|
|
||||||
libname &libref2 clear;
|
libname &libref2 clear;
|
||||||
@@ -150,4 +150,4 @@ options noquotelenmax;
|
|||||||
filename &fname1 clear;
|
filename &fname1 clear;
|
||||||
libname &libref1 clear;
|
libname &libref1 clear;
|
||||||
%end;
|
%end;
|
||||||
%mend;
|
%mend mv_createfolder;
|
||||||
@@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
|
|
||||||
@param root= The path for which to return the list of folders
|
@param root= The path for which to return the list of folders
|
||||||
@param outds= The output dataset to create (default is work.mv_getfolders)
|
@param outds= The output dataset to create (default is work.mv_getfolders). Format:
|
||||||
|
|ordinal_root|ordinal_items|creationTimeStamp| modifiedTimeStamp|createdBy|modifiedBy|id| uri|added| type|name|description|
|
||||||
|
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||
|
|1|1|2021-05-25T11:15:04.204Z|2021-05-25T11:15:04.204Z|allbow|allbow|4f1e3945-9655-462b-90f2-c31534b3ca47|/folders/folders/ed701ff3-77e8-468d-a4f5-8c43dec0fd9e|2021-05-25T11:15:04.212Z|child|my_folder_name|My folder Description|
|
||||||
|
|
||||||
@param access_token_var= The global macro variable to contain the access token
|
@param access_token_var= The global macro variable to contain the access token
|
||||||
@param grant_type= valid values are "password" or "authorization_code" (unquoted).
|
@param grant_type= valid values are "password" or "authorization_code" (unquoted).
|
||||||
The default is authorization_code.
|
The default is authorization_code.
|
||||||
@@ -116,4 +120,4 @@ options noquotelenmax;
|
|||||||
filename &fname1 clear;
|
filename &fname1 clear;
|
||||||
libname &libref1 clear;
|
libname &libref1 clear;
|
||||||
|
|
||||||
%mend;
|
%mend mv_getfoldermembers;
|
||||||
Reference in New Issue
Block a user