Skip to content

Commit 7ff5ba9

Browse files
authored
Merge pull request #207 from adpe/feature/init-git
Specify Git path during initialization
2 parents 7eb376c + 7937fa1 commit 7ff5ba9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mdk/commands/init.py

+14
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ def run(self, args):
138138
C.set('dirs.storage', storage)
139139
break
140140

141+
while True:
142+
git = question('What is the path of your Git installation?', C.get('git'))
143+
git = self.resolve_directory(git, username)
144+
145+
if not os.access(git, os.X_OK):
146+
logging.error('Error while executing the Git command by path %s' % git + '.\nPlease fix or use another executable path.')
147+
continue
148+
149+
gitversion = subprocess.run([git, '--version'], stdout=subprocess.PIPE)
150+
logging.info('Using ' + gitversion.stdout.decode('utf-8'))
151+
152+
C.set('git', git)
153+
break
154+
141155
# The default configuration file should point to the right directory for dirs.mdk,
142156
# we will just ensure that it exists.
143157
mdkdir = C.get('dirs.mdk')

0 commit comments

Comments
 (0)