mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
parent
26e60fa333
commit
b81c9802ae
28 changed files with 58 additions and 58 deletions
|
|
@ -11,4 +11,4 @@ def environment_dir(ENVIRONMENT_DIR, language_version):
|
|||
if ENVIRONMENT_DIR is None:
|
||||
return None
|
||||
else:
|
||||
return '{0}-{1}'.format(ENVIRONMENT_DIR, language_version)
|
||||
return '{}-{}'.format(ENVIRONMENT_DIR, language_version)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ def install_environment(
|
|||
with clean_path_on_failure(env_dir):
|
||||
cmd = [
|
||||
sys.executable, '-m', 'nodeenv', '--prebuilt',
|
||||
'{{prefix}}{0}'.format(directory),
|
||||
'{{prefix}}{}'.format(directory),
|
||||
]
|
||||
|
||||
if version != 'default':
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ def norm_version(version):
|
|||
# If it is in the form pythonx.x search in the default
|
||||
# place on windows
|
||||
if version.startswith('python'):
|
||||
return r'C:\{0}\python.exe'.format(version.replace('.', ''))
|
||||
return r'C:\{}\python.exe'.format(version.replace('.', ''))
|
||||
|
||||
# Otherwise assume it is a path
|
||||
return os.path.expanduser(version)
|
||||
|
|
@ -67,7 +67,7 @@ def install_environment(
|
|||
with clean_path_on_failure(repo_cmd_runner.path(directory)):
|
||||
venv_cmd = [
|
||||
sys.executable, '-m', 'virtualenv',
|
||||
'{{prefix}}{0}'.format(directory)
|
||||
'{{prefix}}{}'.format(directory)
|
||||
]
|
||||
if version != 'default':
|
||||
venv_cmd.extend(['-p', norm_version(version)])
|
||||
|
|
|
|||
|
|
@ -70,20 +70,20 @@ def _install_rbenv(repo_cmd_runner, version='default'):
|
|||
# We also modify the PS1 variable for manual debugging sake.
|
||||
activate_file.write(
|
||||
'#!/usr/bin/env bash\n'
|
||||
"export RBENV_ROOT='{0}'\n"
|
||||
"export RBENV_ROOT='{directory}'\n"
|
||||
'export PATH="$RBENV_ROOT/bin:$PATH"\n'
|
||||
'eval "$(rbenv init -)"\n'
|
||||
'export PS1="(rbenv)$PS1"\n'
|
||||
# This lets us install gems in an isolated and repeatable
|
||||
# directory
|
||||
"export GEM_HOME='{0}/gems'\n"
|
||||
"export GEM_HOME='{directory}/gems'\n"
|
||||
'export PATH="$GEM_HOME/bin:$PATH"\n'
|
||||
'\n'.format(repo_cmd_runner.path(directory))
|
||||
'\n'.format(directory=repo_cmd_runner.path(directory))
|
||||
)
|
||||
|
||||
# If we aren't using the system ruby, add a version here
|
||||
if version != 'default':
|
||||
activate_file.write('export RBENV_VERSION="{0}"\n'.format(version))
|
||||
activate_file.write('export RBENV_VERSION="{}"\n'.format(version))
|
||||
|
||||
|
||||
def _install_ruby(runner, version):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue