diff --git a/setup.m b/setup.m index cc6d190..b9f8b02 100644 --- a/setup.m +++ b/setup.m @@ -1,17 +1,19 @@ function setup() % to execute once after cloning the repo. createDefaultConfigFile(); addpath(genpath(pwd)); end function createDefaultConfigFile() - % should create a class to read/write variables in config file. - fid = fopen('config.txt','w'); - fprintf(fid,'maxSCaseIDDigits = 3\n'); - fprintf(fid,'SCaseIDValidTypes = ''NP''\n'); - fprintf(fid,'pythonDir = ''/shoulder/methods/python/rcseg''\n'); - fprintf(fid,'dataDir = ''/shoulder/dataDev''\n'); + defaultConfig.maxSCaseIDDigits = 3; + defaultConfig.SCaseIDValidTypes = "NP"; + defaultConfig.pythonDir = "/shoulder/methods/python/rcseg"; + defaultConfig.dataDir = "/shoulder/dataDev"; + + fid = fopen('config.json','w'); + fprintf(fid, replace(jsonencode(defaultConfig), ",", ",\n")); + fclose(fid); end \ No newline at end of file