From d5f6369b08f8a36c38a09abbaf18ba4b1cd84d16 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Mon, 18 Jun 2018 18:32:21 -0700 Subject: [PATCH 1/3] fix travis --- build/download.sh | 128 +--------------------------------------------- 1 file changed, 1 insertion(+), 127 deletions(-) diff --git a/build/download.sh b/build/download.sh index 77e908b8ab..d6ff313ca8 100755 --- a/build/download.sh +++ b/build/download.sh @@ -1,127 +1 @@ -#!/usr/bin/env bash - -# Let's quit on interrupt of subcommands -trap ' - trap - INT # restore default INT handler - echo "Interrupted" - kill -s INT "$$" -' INT - -get_url() { - fork=$2 - release=v6.0.0-beta.1 - echo "https://github.com/$fork/PowerShell/releases/download/$release/$1" -} - -fork="PowerShell" -# Get OS specific asset ID and package name -case "$OSTYPE" in - linux*) - source /etc/os-release - # Install curl and wget to download package - case "$ID" in - centos*) - if ! hash curl 2>/dev/null; then - echo "curl not found, installing..." - sudo yum install -y curl - fi - - package=powershell-6.0.0_beta.1-1.el7.centos.x86_64.rpm - ;; - ubuntu) - if ! hash curl 2>/dev/null; then - echo "curl not found, installing..." - sudo apt-get install -y curl - fi - - case "$VERSION_ID" in - 14.04) - package=powershell_6.0.0-beta.1-1ubuntu1.14.04.1_amd64.deb - ;; - 16.04) - package=powershell_6.0.0-beta.1-1ubuntu1.16.04.1_amd64.deb - ;; - *) - echo "Ubuntu $VERSION_ID is not supported!" >&2 - exit 2 - esac - ;; - opensuse) - if ! hash curl 2>/dev/null; then - echo "curl not found, installing..." - sudo zypper install -y curl - fi - - - case "$VERSION_ID" in - 42.1) - # TODO during next release remove fork and fix package name - fork=TravisEz13 - package=powershell-6.0.0_beta.1-1.suse.42.1.x86_64.rpm - ;; - *) - echo "OpenSUSE $VERSION_ID is not supported!" >&2 - exit 2 - esac - ;; - *) - echo "$NAME is not supported!" >&2 - exit 2 - esac - ;; - darwin*) - # We don't check for curl as macOS should have a system version - package=powershell-6.0.0-beta.1-osx.10.12-x64.pkg - ;; - *) - echo "$OSTYPE is not supported!" >&2 - exit 2 - ;; -esac - -curl -L -o "$package" $(get_url "$package" "$fork") - -if [[ ! -r "$package" ]]; then - echo "ERROR: $package failed to download! Aborting..." >&2 - exit 1 -fi - -# Installs PowerShell package -case "$OSTYPE" in - linux*) - source /etc/os-release - # Install dependencies - echo "Installing PowerShell with sudo..." - case "$ID" in - centos) - # yum automatically resolves dependencies for local packages - sudo yum install "./$package" - ;; - ubuntu) - # dpkg does not automatically resolve dependencies, but spouts ugly errors - sudo dpkg -i "./$package" &> /dev/null - # Resolve dependencies - sudo apt-get install -f - ;; - opensuse) - # Install the Microsoft public key so that zypper trusts the package - sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc - # zypper automatically resolves dependencies for local packages - sudo zypper --non-interactive install "./$package" &> /dev/null - ;; - *) - esac - ;; - darwin*) - echo "Installing $package with sudo ..." - sudo installer -pkg "./$package" -target / - ;; -esac - -powershell -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME"' -success=$? - -if [[ "$success" != 0 ]]; then - echo "ERROR: PowerShell failed to install!" >&2 - exit "$success" -fi \ No newline at end of file +bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) \ No newline at end of file From 2c03024645c750cd495ef4f0dbd7f80a06a63a4b Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Mon, 18 Jun 2018 18:35:05 -0700 Subject: [PATCH 2/3] powershell -> pwsh --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81112c66df..9a12673af5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,4 @@ install: script: - ulimit -n 4096 - - sudo powershell -Command "Install-Module PowerShellGet -Force" - - powershell -File build/travis.ps1 + - pwsh -File build/travis.ps1 From e47baafd7f6420b8079c952a91ca4036968fd66d Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Mon, 18 Jun 2018 19:37:08 -0700 Subject: [PATCH 3/3] delete download.sh --- .travis.yml | 2 +- build/download.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100755 build/download.sh diff --git a/.travis.yml b/.travis.yml index 9a12673af5..747c8ad08b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: install: - git clone https://github.com/PowerShell/PowerShellEditorServices.git ../PowerShellEditorServices - pushd build - - ./download.sh + - bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) - popd script: diff --git a/build/download.sh b/build/download.sh deleted file mode 100755 index d6ff313ca8..0000000000 --- a/build/download.sh +++ /dev/null @@ -1 +0,0 @@ -bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) \ No newline at end of file