forked from opencobra/cobratoolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to mainly use the COBRA gitignore information
- Loading branch information
Showing
7 changed files
with
105 additions
and
42 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
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 was deleted.
Oops, something went wrong.
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,43 @@ | ||
function removeTempFiles(directory, oldcontent, COBRAGitIgnoredOnly) | ||
% Removes all files that are in the specified directory but not part of | ||
% the oldcontent. By default only removes those files which match files | ||
% mentioned in the COBRA .gitignore file. | ||
% USAGE: | ||
% removeTempFiles(directory, oldcontent, COBRAGitIgnoredOnly) | ||
% | ||
% INPUT: | ||
% directory: The directory which should be checked for changing files. | ||
% content: Absolute file names of the original conten in a cell array. | ||
% | ||
% OPTIONAL INPUT: | ||
% COBRAGitIgnoredOnly: Whether to only remove files which are listed by | ||
% the COBRA gitignore file. | ||
% (Default: true) | ||
% | ||
|
||
|
||
if ~exist('COBRAGitIgnoredOnly','var') | ||
COBRAGitIgnoredOnly = true; | ||
end | ||
|
||
currentDir = cd(directory); | ||
|
||
if COBRAGitIgnoredOnly | ||
gitTypeFlag = 'COBRAIgnored'; | ||
else | ||
gitTypeFlag = 'all'; | ||
end | ||
|
||
% get the new Content of the folder. | ||
newContent = getFilesInDir('gitTypeFlag',gitTypeFlag); | ||
|
||
% get all .log files that were present only after initCobraToolbox was called. | ||
newIgnoredFiles = setdiff(newContent, oldcontent); | ||
|
||
% by adding the folder, we already have the correct path. | ||
if ~isempty(newIgnoredFiles) | ||
delete(newIgnoredFiles{:}); | ||
end | ||
|
||
cd(currentDir); | ||
end |
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