Skip to content

Commit 1f71524

Browse files
authored
Merge pull request #31 from WegrzynAB/fix-defaultDir
Ask about default directory & remove empty submodule
2 parents 6a919d4 + bc2635e commit 1f71524

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "external/rdir"]
2-
path = external/rdir
3-
url = https://github.com/LCSB-BioCore/rdir.git

external/rdir

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/initDevTools.m

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ function initDevTools(repoName,currentDir)
9898

9999
% retrieve the directory of the fork from the local git configuration
100100
[~, result_gitConfForkDirGet] = system(['git config --get user.', gitConf.leadForkDirName, gitConf.nickName, '.path']);
101-
if isempty(result_gitConfForkDirGet)
102-
fprintf('%s%s%s\n','Attempting to progress by assuming the current directory (', currentDir, ') is a fork directory.')
103-
gitConf.fullForkDir=currentDir;
104-
gitConf.localDir = gitConf.fullForkDir;
105-
else
101+
if ~isempty(result_gitConfForkDirGet)
106102
gitConf.fullForkDir = strtrim(result_gitConfForkDirGet);
107103
gitConf.localDir = gitConf.fullForkDir;
104+
else
105+
fprintf('%s\n','No existing information about the location of the fork directory.')
106+
gitConf.fullForkDir = '';
107+
gitConf.localDir = '';
108108
end
109109

110110
% check if the fork exists remotely
@@ -195,7 +195,14 @@ function initDevTools(repoName,currentDir)
195195

196196
% only update if there are no local changes
197197
if status_gitStatus == 0 && isempty(result_gitStatus)
198-
updateFork(true);
198+
reply = input([gitCmd.lead, originCall, ' Do you want to update your fork? Y/N [Y]:'], 's');
199+
200+
% update fork if requested
201+
if (isempty(reply) || strcmpi(reply, 'y') || strcmpi(reply, 'yes'))
202+
updateFork(true);
203+
end
204+
205+
199206
else
200207
printMsg(mfilename, 'The local fork cannot be updated as you have uncommitted changes.', [gitCmd.fail, gitCmd.trail]);
201208
end

0 commit comments

Comments
 (0)