Skip to content

Commit e4dc938

Browse files
committed
Get macOS working and fix misc issue
1 parent fdabe86 commit e4dc938

9 files changed

Lines changed: 43 additions & 43 deletions

.spelling

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,10 @@ WebRequest
889889
win7-x86
890890
WindowsVersion
891891
XPath
892+
alpha.18
893+
behavioral
894+
MiaRomero
895+
TheFlyingCorpse
892896
Youtube
893897
- test/tools/CodeCoverageAutomation/README.md
894898
CodeCoverage.zip
@@ -914,3 +918,6 @@ post-6
914918
- CODE_OF_CONDUCT.md
915919
opencode
916920
microsoft.com
921+
- ./tools/install-powershell.readme.md
922+
includeide
923+
sed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ addons:
2121

2222
install:
2323
- pushd tools
24-
- ./download.sh
24+
- ./install-powershell.sh
2525
- popd
2626
# Default 2.0.0 Ruby is buggy
2727
# Default bundler version is buggy

test/common/markdown/markdown.tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Describe 'Common Tests - Validate Markdown Files' -Tag 'CI' {
7878
'./docs/maintainers/README.md'
7979
'./demos/SSHRemoting/*.md'
8080
'./docker/*.md'
81+
'./tools/*.md'
8182
)
8283
$filter = ($docsToTest -join ',')
8384
&"gulp" test-mdsyntax --silent `

tools/install-powershell-readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ bash install-powershell.sh <ARGUMENTS>
3737

3838
## Examples
3939

40-
### Only Install PowerShell Core:
40+
### Only Install PowerShell Core
4141

4242
```bash
4343
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh)
4444
```
4545

46-
### Install PowerShell Core with IDE:
46+
### Install PowerShell Core with IDE
4747

4848
```bash
4949
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -includeide
5050
```
5151

52-
### Install PowerShell Core with IDE and do tests that require a human to interact with the install process:
52+
### Install PowerShell Core with IDE and do tests that require a human to interact with the installation process
5353

5454
```bash
5555
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -includeide -interactivetesting
5656
```
5757

58-
### Install AppImage:
58+
### Install AppImage
5959

6060
```bash
6161
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -appimage

tools/install-powershell.sh

100644100755
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
VERSION="1.1.0"
2525
gitreposubpath="PowerShell/PowerShell/master"
26-
gitreposubpath="darwinjs/PowerShell/feature/install-powershell.sh"
2726
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
2827
gitscriptname="install-powershell.psh"
2928

@@ -52,10 +51,14 @@ MACH=`uname -m`
5251
if [ "${OS}" == "windowsnt" ]; then
5352
OS=windows
5453
DistroBasedOn=windows
54+
SCRIPTFOLDER=$(dirname $(readlink -f $0))
5555
elif [ "${OS}" == "darwin" ]; then
5656
OS=osx
5757
DistroBasedOn=osx
58+
# readlink doesn't work the same on macOS
59+
SCRIPTFOLDER=$(dirname $0)
5860
else
61+
SCRIPTFOLDER=$(dirname $(readlink -f $0))
5962
OS=`uname`
6063
if [ "${OS}" == "SunOS" ] ; then
6164
OS=solaris
@@ -110,7 +113,7 @@ echo " REV: $REV"
110113
echo " KERNEL: $KERNEL"
111114
echo " MACH: $MACH"
112115

113-
SCRIPTFOLDER=$(dirname $(readlink -f $0))
116+
114117

115118
if [[ "'$*'" =~ appimage ]] ; then
116119
if [ -f $SCRIPTFOLDER/appimage.sh ]; then
@@ -136,4 +139,3 @@ elif [ "$DistroBasedOn" == "redhat" ] || [ "$DistroBasedOn" == "debian" ] || [ "
136139
else
137140
echo "Sorry, your operating system is based on $DistroBasedOn and is not supported by PowerShell Core or this installer at this time."
138141
fi
139-

tools/installpsh-debian.sh

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
VERSION="1.1.2"
2222
gitreposubpath="PowerShell/PowerShell/master"
23-
gitreposubpath="darwinjs/PowerShell/feature/install-powershell.sh"
2423
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
2524
thisinstallerdistro=debian
2625
repobased=true
@@ -166,4 +165,4 @@ if [[ "$repobased" == true ]] ; then
166165
echo
167166
echo "*** NOTE: Run your regular package manager update cycle to update PowerShell Core\n"
168167
fi
169-
echo "*** Install Complete"
168+
echo "*** Install Complete"

tools/installpsh-osx.sh

100644100755
Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020

2121
VERSION="1.1.2"
2222
gitreposubpath="PowerShell/PowerShell/master"
23-
gitreposubpath="darwinjs/PowerShell/feature/install-powershell.sh"
2423
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
2524
thisinstallerdistro=osx
2625
repobased=true
27-
gitscriptname="installpsh-osx.psh"
26+
gitscriptname="installpsh-osx.sh"
2827

2928
echo "\n*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
3029
echo "*** Current PowerShell Core Version: $currentpshversion"
@@ -42,6 +41,9 @@ trap '
4241
lowercase(){
4342
echo "$1" | tr [A-Z] [a-z]
4443
}
44+
45+
OS=`lowercase \`uname\``
46+
4547
if [ "${OS}" == "windowsnt" ]; then
4648
OS=windows
4749
DistroBasedOn=windows
@@ -114,55 +116,46 @@ echo "\n*** Installing PowerShell Core for $DistroBasedOn..."
114116

115117
if ! hash brew 2>/dev/null; then
116118
echo "Homebrew is not found, installing..."
117-
$SUDO ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null
119+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
120+
else
121+
echo "Howebrew is already installed, skipping..."
118122
fi
119123

120-
if hash brew 2>/dev/null; then
124+
if ! hash brew 2>/dev/null; then
121125
echo "ERROR: brew did not install correctly, exiting..." >&2
122126
exit 3
123127
fi
124128

125-
if [[ ! -d $(brew --prefix openssl) ]]; then
126-
echo "Installing OpenSSL..."
127-
if ! $SUDO brew install openssl; then
128-
echo "ERROR: OpenSSL failed to install! Crypto functions will not work..." >&2
129-
fi
130-
else
131-
$SUDO brew upgrade openssl
132-
fi
133-
134-
if [[ ! -d $(brew --prefix curl) ]]; then
135-
if ! $SUDO brew install curl --with-openssl; then
136-
echo "ERROR: curl failed to build against OpenSSL; SSL functions will not work..." >&2
137-
fi
138-
else
139-
if ! $SUDO brew reinstall curl --with-openssl; then
140-
echo "ERROR: curl failed to build against OpenSSL; SSL functions will not work..." >&2
129+
# Suppress output, it's very noisy on travis-ci
130+
if [[ ! -d $(brew --prefix cask) ]]; then
131+
echo "Installing cask..."
132+
if ! brew tap caskroom/cask >/dev/null; then
133+
echo "ERROR: Cask failed to install! Cannot install powershell..." >&2
141134
fi
142135
fi
143136

144-
if [[ ! -d $(brew --prefix powershell) ]]; then
145-
if ! $SUDO brew install powershell; then
146-
echo "ERROR: powershell failed to install..." >&2
147-
exit 1
137+
if ! hash powershell 2>/dev/null; then
138+
echo "Installing PowerShell..."
139+
if ! brew cask install powershell; then
140+
echo "ERROR: PowerShell failed to install! Cannot install powershell..." >&2
148141
fi
149142
else
150-
$SUDO brew upgrade powershell
143+
echo "PowerShell is already installed, skipping..."
151144
fi
152145

153146
if [[ "'$*'" =~ includeide ]] ; then
154147
echo "\n*** Installing VS Code PowerShell IDE..."
155148
if [[ ! -d $(brew --prefix visual-studio-code) ]]; then
156-
if ! $SUDO brew install visual-studio-code; then
149+
if ! brew install visual-studio-code; then
157150
echo "ERROR: Visual Studio Code failed to install..." >&2
158151
exit 1
159152
fi
160153
else
161-
$SUDO brew upgrade visual-studio-code
154+
brew upgrade visual-studio-code
162155
fi
163156

164157
echo "\n*** Installing VS Code PowerShell Extension"
165-
$SUDO code --install-extension ms-vscode.PowerShell
158+
code --install-extension ms-vscode.PowerShell
166159
fi
167160

168161
powershell -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME"'
@@ -182,4 +175,4 @@ fi
182175
if [[ "$repobased" == true ]] ; then
183176
echo "*** NOTE: Run your regular package manager update cycle to update PowerShell Core"
184177
fi
185-
echo "*** Install Complete"
178+
echo "*** Install Complete"

tools/installpsh-redhat.sh

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
VERSION="1.1.2"
2222
gitreposubpath="PowerShell/PowerShell/master"
23-
gitreposubpath="darwinjs/PowerShell/feature/install-powershell.sh"
2423
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
2524
thisinstallerdistro=redhat
2625
repobased=true
@@ -159,4 +158,4 @@ fi
159158
if [[ "$repobased" == true ]] ; then
160159
echo "*** NOTE: Run your regular package manager update cycle to update PowerShell Core"
161160
fi
162-
echo "*** Install Complete"
161+
echo "*** Install Complete"

tools/installpsh-suse.sh

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
VERSION="1.1.2"
2222
gitreposubpath="PowerShell/PowerShell/master"
23-
gitreposubpath="darwinjs/PowerShell/feature/install-powershell.sh"
2423
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
2524
thisinstallerdistro=suse
2625
repobased=true
@@ -189,4 +188,4 @@ fi
189188
if [[ "$repobased" == true ]] ; then
190189
echo "*** NOTE: Run your regular package manager update cycle to update PowerShell Core"
191190
fi
192-
echo "*** Install Complete"
191+
echo "*** Install Complete"

0 commit comments

Comments
 (0)