forked from Azure/azure-devops-cli-extension
-
Notifications
You must be signed in to change notification settings - Fork 9
/
install
40 lines (30 loc) · 1.39 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------
#
# Bash script to install the VSTS CLI
#
INSTALL_SCRIPT_URL="https://vstscli.blob.core.windows.net/install/install.py"
INSTALL_SCRIPT_SHA256=264f6e73cd46052b0a0e494dbe304c0ea89926c1762cf6e80bca69be3d805c06
_TTY=/dev/tty
install_script=$(mktemp -t vsts_cli_install_tmp_XXXX) || exit
echo "Downloading Microsoft VSTS CLI install script from $INSTALL_SCRIPT_URL to $install_script."
curl -# $INSTALL_SCRIPT_URL > $install_script || exit
# Check validity of the script (temporarily turned off)
#if command -v sha256sum >/dev/null 2>&1
#then
# echo "$INSTALL_SCRIPT_SHA256 $install_script" | sha256sum -c - || exit
#elif command -v shasum >/dev/null 2>&1
#then
# echo "$INSTALL_SCRIPT_SHA256 $install_script" | shasum -a 256 -c - || exit
#fi
#if ! command -v python >/dev/null 2>&1
#then
# echo "ERROR: Python not found. 'command -v python' returned failure."
# echo "If python is available on the system, add it to PATH. For example 'sudo ln -s /usr/bin/python3 /usr/bin/python'"
# exit 1
#fi
chmod 775 $install_script
$install_script < $_TTY