From 30bd7867a215f15bc839cb96cdcd0ac8e11b5535 Mon Sep 17 00:00:00 2001 From: Will Smythe Date: Thu, 9 Nov 2017 10:25:19 -0500 Subject: [PATCH] Update git attributes to allow install scripts to be in LF --- .gitattributes | 1 - scripts/curl_install/install | 5 ++++- scripts/curl_install/install.py | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitattributes b/.gitattributes index 0190800fb..a8e99aae4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,4 +15,3 @@ # Shell scripts *.sh eol=lf *.completion eol=lf -install eol=lf diff --git a/scripts/curl_install/install b/scripts/curl_install/install index 6200863b5..66e2310c4 100644 --- a/scripts/curl_install/install +++ b/scripts/curl_install/install @@ -6,7 +6,7 @@ #--------------------------------------------------------------------------------------------- # -# Bash script to install the Azure CLI +# Bash script to install the VSTS CLI # INSTALL_SCRIPT_URL="https://vstscli.blob.core.windows.net/install/install.py" @@ -14,10 +14,13 @@ INSTALL_SCRIPT_SHA256=264f6e73cd46052b0a0e494dbe304c0ea89926c1762cf6e80bca69be3d _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 diff --git a/scripts/curl_install/install.py b/scripts/curl_install/install.py index d28f324b4..cd134dd28 100644 --- a/scripts/curl_install/install.py +++ b/scripts/curl_install/install.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -160,8 +160,11 @@ def create_executable(exec_dir, install_dir): create_dir(exec_dir) exec_filepath = os.path.join(exec_dir, EXECUTABLE_NAME) - os.symlink(actual_exec_filepath, exec_filepath) - + try: + os.symlink(actual_exec_filepath, exec_filepath) + except (OSError, IOError): + pass + cur_stat = os.stat(exec_filepath) os.chmod(exec_filepath, cur_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) print_status("The executable is available at '{}'.".format(exec_filepath))