Skip to content

Commit

Permalink
Update git attributes to allow install scripts to be in LF
Browse files Browse the repository at this point in the history
  • Loading branch information
willsmythe committed Nov 9, 2017
1 parent 8bc4321 commit 30bd786
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Expand Up @@ -15,4 +15,3 @@
# Shell scripts
*.sh eol=lf
*.completion eol=lf
install eol=lf
5 changes: 4 additions & 1 deletion scripts/curl_install/install
Expand Up @@ -6,18 +6,21 @@
#---------------------------------------------------------------------------------------------

#
# 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"
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
Expand Down
9 changes: 6 additions & 3 deletions scripts/curl_install/install.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 30bd786

Please sign in to comment.