Compare commits
4 Commits
5e232430cc
...
1b1e13ecb2
Author | SHA1 | Date | |
---|---|---|---|
1b1e13ecb2 | |||
dc10a4d9ac | |||
b1294fdfdf | |||
ed415a5c9c |
@ -58,7 +58,7 @@ del %~dp0\winsdksetup.exe
|
||||
:: Install Chocolatey
|
||||
:choco
|
||||
set choice=
|
||||
set /p choice="Install Chocolatey (Y/n)?"
|
||||
set /p choice="Install Chocolatey (Y/n)? "
|
||||
if "%choice%"=="" goto choco_yes
|
||||
if "%choice%"=="Y" goto choco_yes
|
||||
if "%choice%"=="y" goto choco_yes
|
||||
@ -74,7 +74,7 @@ if errorlevel 1 exit /B 1
|
||||
:: Install Cmder, including Git
|
||||
:git
|
||||
set choice=
|
||||
set /p choice="Install Cmder, including Git (Y/n)?"
|
||||
set /p choice="Install Cmder, including Git (Y/n)? "
|
||||
if "%choice%"=="" goto git_yes
|
||||
if "%choice%"=="Y" goto git_yes
|
||||
if "%choice%"=="y" goto git_yes
|
||||
@ -90,7 +90,7 @@ if errorlevel 1 exit /B 1
|
||||
:: Install Python
|
||||
:python
|
||||
set choice=
|
||||
set /p choice="Install Python (Y/n)?"
|
||||
set /p choice="Install Python (Y/n)? "
|
||||
if "%choice%"=="" goto python_yes
|
||||
if "%choice%"=="Y" goto python_yes
|
||||
if "%choice%"=="y" goto python_yes
|
||||
@ -106,7 +106,7 @@ if errorlevel 1 exit /B 1
|
||||
:: Install virtualenv
|
||||
:virtualenv
|
||||
set choice=
|
||||
set /p choice="Install virtualenv (Y/n)?"
|
||||
set /p choice="Install virtualenv (Y/n)? "
|
||||
if "%choice%"=="" goto virtualenv_yes
|
||||
if "%choice%"=="Y" goto virtualenv_yes
|
||||
if "%choice%"=="y" goto virtualenv_yes
|
||||
@ -122,7 +122,7 @@ if errorlevel 1 exit /B 1
|
||||
:: Generate SSH key
|
||||
:ssh_key
|
||||
set choice=
|
||||
set /p choice="Generate SSH key (Y/n)?"
|
||||
set /p choice="Generate SSH key (Y/n)? "
|
||||
if "%choice%"=="" goto ssh_key_yes
|
||||
if "%choice%"=="Y" goto ssh_key_yes
|
||||
if "%choice%"=="y" goto ssh_key_yes
|
||||
@ -142,7 +142,7 @@ if errorlevel 1 exit /B 1
|
||||
:: Add git to the PATH to pip can find it
|
||||
set PATH=C:\tools\cmder\vendor\git-for-windows\bin;%PATH%
|
||||
set choice=
|
||||
set /p choice="Set SSH keys on remote Git servers (Y/n)?"
|
||||
set /p choice="Set SSH keys on remote Git servers (Y/n)? "
|
||||
if "%choice%"=="" goto remote_ssh_keys_yes
|
||||
if "%choice%"=="Y" goto remote_ssh_keys_yes
|
||||
if "%choice%"=="y" goto remote_ssh_keys_yes
|
||||
@ -157,10 +157,23 @@ if errorlevel 1 exit /B 1
|
||||
if errorlevel 1 exit /B 1
|
||||
"%~dp0\bootstrap_env\Scripts\python.exe" -c "import bootstrap; bootstrap.set_ssh_keys()"
|
||||
if errorlevel 1 exit /B 1
|
||||
:remote_ssh_keys_no
|
||||
|
||||
:remove_bootstrap
|
||||
set choice=
|
||||
set /p choice="Remove bootstrap-Windows.cmd (y/N)? "
|
||||
if "%choice%"=="" goto remove_bootstrap_no
|
||||
if "%choice%"=="Y" goto remove_bootstrap_yes
|
||||
if "%choice%"=="y" goto remove_bootstrap_yes
|
||||
if "%choice%"=="N" goto remove_bootstrap_no
|
||||
if "%choice%"=="n" goto remove_bootstrap_no
|
||||
echo invalid value: %choice%
|
||||
goto remove_bootstrap
|
||||
:remove_bootstrap_yes
|
||||
rmdir /Q /S "%~dp0\bootstrap_env"
|
||||
echo "Completed: %0 will now be removed"
|
||||
start /b "" cmd /c del "%~f0"&exit /b
|
||||
:remote_ssh_keys_no
|
||||
:remove_bootstrap_no
|
||||
|
||||
:end
|
||||
endlocal
|
||||
|
@ -5,6 +5,7 @@ from getpass import getpass
|
||||
from os import environ
|
||||
from os.path import join
|
||||
from platform import node, system
|
||||
|
||||
from requests import ConnectionError, get, post
|
||||
from requests.auth import HTTPBasicAuth
|
||||
from requests.compat import urlparse
|
||||
@ -126,10 +127,9 @@ def set_gitlab_ssh_key():
|
||||
|
||||
def set_bitbucket_cloud_ssh_key():
|
||||
"""Set BitBucket Cloud SSH key."""
|
||||
api_url = 'https://api.bitbucket.org/1.0'
|
||||
username, password = get_username_password('BitBucket Cloud')
|
||||
keys_url = 'https://api.bitbucket.org/1.0/users/%s/ssh-keys' % username
|
||||
auth = HTTPBasicAuth(username, password)
|
||||
keys_url = '%s/users/%s/ssh-keys' % (api_url, username)
|
||||
response = get(keys_url, auth=auth)
|
||||
if response.status_code != 200:
|
||||
raise bootstrap_error(response)
|
||||
|
Loading…
x
Reference in New Issue
Block a user