Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ addons:
- pester-tests.xml

install:
# Default 2.0.0 Ruby is buggy
# Default bundler version is buggy
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
rvm install ruby-2.3.3;
rvm --default use 2.3.3;
fi
- pushd tools
- ./install-powershell.sh
- popd
# Default 2.0.0 Ruby is buggy
# Default bundler version is buggy
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rvm install ruby-2.3.1; rvm use 2.3.1; fi
# spellcheck
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
nvm install 6.4.0 &&
Expand Down
39 changes: 19 additions & 20 deletions tools/installpsh-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ thisinstallerdistro=osx
repobased=true
gitscriptname="installpsh-osx.sh"

echo "\n*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
echo "*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
echo "*** Current PowerShell Core Version: $currentpshversion"
echo "*** Original script is at: $gitreposcriptroot/$gitscriptname"
echo "\n*** Arguments used: $* \n\n"
echo "*** Arguments used: $*"

# Let's quit on interrupt of subcommands
trap '
Expand Down Expand Up @@ -93,14 +93,13 @@ if (( $EUID != 0 )); then
fi

#Check that sudo is available
if [[ "$SUDO" -eq "sudo" ]]; then

$SUDO -v
if [ $? -ne 0]; then
echo "ERROR: You must either be root or be able to use sudo" >&2
exit 5
fi
fi
#if [[ "$SUDO" -eq "sudo" ]]; then
Copy link
Member

@TravisEz13 TravisEz13 Oct 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this commented code if it's not needed. Perhaps we can wait until someone complains before making further changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me if this is needed for local execution of this script or if anyone actually uses these scripts locally outside of CI

# $SUDO -v
# if [ $? -ne 0 ]; then
# echo "ERROR: You must either be root or be able to use sudo" >&2
# exit 5
# fi
#fi

#END Collect any variation details if required for this distro

Expand All @@ -110,7 +109,7 @@ fi

##END Check requirements and prerequisites

echo "\n*** Installing PowerShell Core for $DistroBasedOn..."
echo "*** Installing PowerShell Core for $DistroBasedOn..."

#release=`curl https://api.github.com/repos/powershell/powershell/releases/latest | sed '/tag_name/!d' | sed s/\"tag_name\"://g | sed s/\"//g | sed s/v//g | sed s/,//g | sed s/\ //g`

Expand All @@ -126,6 +125,13 @@ if ! hash brew 2>/dev/null; then
exit 3
fi

# Suppress output, it's very noisy on travis-ci
echo "Refreshing Homebrew cache..."
if ! brew update > /dev/null; then
echo "ERROR: Refreshing Homebrew cache failed..." >&2
exit 2
fi

# Suppress output, it's very noisy on travis-ci
if [[ ! -d $(brew --prefix cask) ]]; then
echo "Installing cask..."
Expand All @@ -135,13 +141,6 @@ if [[ ! -d $(brew --prefix cask) ]]; then
fi
fi

# Suppress output, it's very noisy on travis-ci
echo "Refreshing Homebrew cache..."
if ! brew update >/dev/null; then
echo "ERROR: Refreshing Homebrew cache failed..." >&2
exit 2
fi

if ! hash powershell 2>/dev/null; then
echo "Installing PowerShell..."
if ! brew cask install powershell; then
Expand All @@ -152,7 +151,7 @@ else
fi

if [[ "'$*'" =~ includeide ]] ; then
echo "\n*** Installing VS Code PowerShell IDE..."
echo "*** Installing VS Code PowerShell IDE..."
if [[ ! -d $(brew --prefix visual-studio-code) ]]; then
if ! brew cask install visual-studio-code; then
echo "ERROR: Visual Studio Code failed to install..." >&2
Expand All @@ -162,7 +161,7 @@ if [[ "'$*'" =~ includeide ]] ; then
brew upgrade visual-studio-code
fi

echo "\n*** Installing VS Code PowerShell Extension"
echo "*** Installing VS Code PowerShell Extension"
code --install-extension ms-vscode.PowerShell
fi

Expand Down