/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v7.5.4
docker/InstallTarballPackage.sh
41 строка
1 KB
Reece Dunham
Cleanup Docker release testing (#10310)
07 авг 2019, 00:17
07 авг 2019, 00:17
9eb5587
Код
Авторство
О чём код?
#!/bin/sh # Exit on errors set -e # Example use: # ./InstallTarballPackage.sh "6.0.0-beta.9" "powershell-6.0.0-beta.9-linux-x64.tar.gz" usage() { echo "usage: $0 <powershell version> <powershell package name>" exit 1 } POWERSHELL_VERSION=$1 if [ ! "$POWERSHELL_VERSION" ]; then usage fi POWERSHELL_PACKAGE=$2 if [ ! "$POWERSHELL_PACKAGE" ]; then usage fi POWERSHELL_LINKFILE=/usr/bin/pwsh # Download the powershell .tar.gz package curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$POWERSHELL_VERSION/$POWERSHELL_PACKAGE # Create the target folder where powershell will be placed mkdir -p /opt/microsoft/powershell/$POWERSHELL_VERSION # Expand powershell to the target folder tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/$POWERSHELL_VERSION # Create the symbolic link that points to powershell ln -s /opt/microsoft/powershell/$POWERSHELL_VERSION/pwsh $POWERSHELL_LINKFILE # Add the symbolic link path to /etc/shells if [ ! -f /etc/shells ]; then echo $POWERSHELL_LINKFILE > /etc/shells ; else grep -q "^${POWERSHELL_LINKFILE}$" /etc/shells || echo $POWERSHELL_LINKFILE >> /etc/shells ; fi