Home > functions > internal > dsMakeDefaultConfigJenkins.m

dsMakeDefaultConfigJenkins

PURPOSE ^

dsMakeDefaultConfig - write default DS config vars to disk as text file in main DS dir.

SYNOPSIS ^

function makeDefaultConfigJenkins()

DESCRIPTION ^

 dsMakeDefaultConfig - write default DS config vars to disk as text file in main DS dir.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function makeDefaultConfigJenkins()
0002 % dsMakeDefaultConfig - write default DS config vars to disk as text file in main DS dir.
0003 
0004 %% Get Vars
0005 % Get home path
0006 if ispc
0007     host_name= getenv('COMPUTERNAME');
0008     home_path= getenv('HOMEPATH');
0009 else
0010     [~, host_name]=system('echo $HOSTNAME');
0011     home_path= getenv('HOME');
0012 end
0013 host_name = strtrim(host_name); % remove whitespace from host_name
0014 
0015 docs_path = fullfile(home_path, 'Documents');
0016 
0017 % System-specific customization
0018 ds_data_path = fullfile(docs_path,'DynaSimData');
0019 demos_path = fullfile(ds_data_path, 'demos');
0020 
0021 ds_temp_root_path = fileparts(fileparts(which('dsSimulate')));
0022 
0023 ds_root_path = getPath('ds');
0024 
0025 demos_zips_path = fullfile(ds_root_path, 'demos','demo_zips');
0026 
0027 ds_unitTestData_path = fullfile(ds_root_path, 'unitTestData');
0028 
0029 %% Write vars to disk
0030 vars = who; % get all vars
0031 
0032 fid = fopen(fullfile(ds_temp_root_path, 'dsConfig.txt'), 'w');
0033 
0034 for thisVar = vars(:)'
0035   thisVar = thisVar{1};
0036   
0037   fprintf(fid, '%s = "%s"\r\n', thisVar,eval(thisVar));
0038 end
0039 
0040 fclose(fid);
0041 
0042 end

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005