You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updating for pull request comments
OSX Install script updated to use repositories
Using TR, use curl rather than wget since we ensured it is on the system
Update comments in install-powershell.sh
install-powershell.sh
echo"*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
31
+
echo"*** Current PowerShell Core Version: $currentpshversion"
32
+
echo"*** Original script is at: $gitreposcriptroot/$gitscriptname"
33
+
echo
34
+
echo"*** Arguments used: $*"
35
+
36
+
#Verify The Installer Choice (for direct runs of this script)
37
+
lowercase(){
38
+
#echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
39
+
echo"$1"| tr [A-Z] [a-z]
40
+
}
41
+
42
+
# Let's quit on interrupt of subcommands
43
+
trap'
44
+
trap - INT # restore default INT handler
45
+
echo "Interrupted"
46
+
kill -s INT "$$"
47
+
' INT
48
+
49
+
if [ "${OS}"=="windowsnt" ];then
50
+
OS=windows
51
+
DistroBasedOn=windows
52
+
elif [ "${OS}"=="darwin" ];then
53
+
OS=osx
54
+
DistroBasedOn=osx
55
+
else
56
+
OS=`uname`
57
+
if [ "${OS}"=="SunOS" ] ;then
58
+
OS=solaris
59
+
ARCH=`uname -p`
60
+
OSSTR="${OS}${REV}(${ARCH}`uname -v`)"
61
+
DistroBasedOn=sunos
62
+
elif [ "${OS}"=="AIX" ] ;then
63
+
OSSTR="${OS}`oslevel` (`oslevel -r`)"
64
+
DistroBasedOn=aix
65
+
elif [ "${OS}"=="Linux" ] ;then
66
+
if [ -f /etc/redhat-release ] ;then
67
+
DistroBasedOn='redhat'
68
+
elif [ -f /etc/SuSE-release ] ;then
69
+
DistroBasedOn='suse'
70
+
elif [ -f /etc/mandrake-release ] ;then
71
+
DistroBasedOn='mandrake'
72
+
elif [ -f /etc/debian_version ] ;then
73
+
DistroBasedOn='debian'
74
+
fi
75
+
if [ -f /etc/UnitedLinux-release ] ;then
76
+
DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n"''| sed s/VERSION.*//`]"
77
+
DistroBasedOn=unitedlinux
78
+
fi
79
+
OS=`lowercase $OS`
80
+
DistroBasedOn=`lowercase $DistroBasedOn`
81
+
fi
82
+
fi
83
+
84
+
if [ "$DistroBasedOn"!="$thisinstallerdistro" ];then
85
+
echo"*** This installer is only for $thisinstallerdistro and you are running $DistroBasedOn, please run \"$gitreporoot\install-powershell.sh\" to see if your distro is supported AND to auto-select the appropriate installer if it is."
86
+
exit 0
87
+
fi
88
+
89
+
## Check requirements and prerequisites
90
+
91
+
#Only do SUDO if we are not root
92
+
SUDO=''
93
+
if(($EUID!=0));then
94
+
SUDO='sudo'
95
+
fi
96
+
97
+
#Check that sudo is available
98
+
if [[ "$SUDO"-eq"sudo" ]];then
99
+
100
+
$SUDO -v
101
+
if [ $?-ne 0 ];then
102
+
echo"ERROR: You must either be root or be able to use sudo">&2
103
+
exit 5
104
+
fi
105
+
fi
106
+
107
+
#Collect any variation details if required for this distro
#END Collect any variation details if required for this distro
110
+
111
+
#If there are known incompatible versions of this distro, put the test, message and script exit here:
112
+
113
+
#END Verify The Installer Choice
114
+
115
+
##END Check requirements and prerequisites
116
+
117
+
echo
118
+
echo"*** Installing PowerShell Core for $DistroBasedOn..."
119
+
if!hash curl 2>/dev/null;then
120
+
echo"curl not found, installing..."
121
+
$SUDO apt-get install -y curl
122
+
fi
123
+
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`
124
+
125
+
echo"*** Current version on git is: $currentversion, repo version may differ slightly..."
0 commit comments