Skip to content

Commit

Permalink
Merge pull request #207 from adpe/feature/init-git
Browse files Browse the repository at this point in the history
Specify Git path during initialization
  • Loading branch information
FMCorz authored Oct 14, 2022
2 parents 7eb376c + 7937fa1 commit 7ff5ba9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mdk/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ def run(self, args):
C.set('dirs.storage', storage)
break

while True:
git = question('What is the path of your Git installation?', C.get('git'))
git = self.resolve_directory(git, username)

if not os.access(git, os.X_OK):
logging.error('Error while executing the Git command by path %s' % git + '.\nPlease fix or use another executable path.')
continue

gitversion = subprocess.run([git, '--version'], stdout=subprocess.PIPE)
logging.info('Using ' + gitversion.stdout.decode('utf-8'))

C.set('git', git)
break

# The default configuration file should point to the right directory for dirs.mdk,
# we will just ensure that it exists.
mdkdir = C.get('dirs.mdk')
Expand Down

0 comments on commit 7ff5ba9

Please sign in to comment.