-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to set username programatically
The username can no be set programmatically by calling arCreateInitUser.
- Loading branch information
1 parent
ac42bc4
commit beaa579
Showing
2 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function arCreateInitUser(userName) | ||
|
||
ar_path = fileparts(which('arInit.m')); | ||
|
||
fid = fopen([ar_path '/arInitUser.m'], 'w'); | ||
if(fid==-1) | ||
error('could not write file %s!', [ar_path '/arInitUser.m']), | ||
end | ||
fprintf(fid,'%s\n','% initialize user settings'); | ||
fprintf(fid,'\n%s\n','function arInitUser'); | ||
fprintf(fid,'\n%s\n','global ar'); | ||
fprintf(fid,'\n%s%s%s','ar.config.username = ''',userName,''';'); | ||
fprintf(fid,'\n%s%s%s','ar.config.comment_string = ''//'';'); | ||
fclose(fid); | ||
fprintf(1,'\n%s\n','Initialization successful'); | ||
fprintf(1,'Please note that you can set additional default options in arInitUser.m\n' ); | ||
|
||
rehash path | ||
end | ||
|