Fix mariner sudo detection (#19304)

* Change the permissions on the symlink created for mariner

* Update installpsh-mariner.sh

* Update install-ps.yml

* Update linux.yml

* Update installpsh-mariner.sh
This commit is contained in:
Travis Plunk 2023-03-13 11:56:41 -07:00 committed by GitHub
parent fb7bb75ebc
commit 7afe8437d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 17 deletions

View File

@ -9,13 +9,8 @@ trigger:
- feature*
paths:
include:
- /tools/install-powershell.sh
- /tools/installpsh-amazonlinux.sh
- /tools/installpsh-debian.sh
- /tools/installpsh-osx.sh
- /tools/installpsh-redhat.sh
- /tools/installpsh-suse.sh
- /tools/install-powershell.ps1
- /tools/install-powershell.*
- /tools/installpsh-*.sh
- /.vsts-ci/install-ps.yml
pr:
branches:
@ -26,11 +21,7 @@ pr:
paths:
include:
- /tools/install-powershell.sh
- /tools/installpsh-amazonlinux.sh
- /tools/installpsh-debian.sh
- /tools/installpsh-osx.sh
- /tools/installpsh-redhat.sh
- /tools/installpsh-suse.sh
- /tools/installpsh-*.sh
- /tools/install-powershell.ps1
- /.vsts-ci/install-ps.yml

View File

@ -44,6 +44,7 @@ pr:
- test/common/markdown/*
- test/perf/*
- tools/releaseBuild/*
- tools/install*
- tools/releaseBuild/azureDevOps/templates/*
- README.md
- .spelling

View File

@ -27,7 +27,7 @@ gitreposubpath="PowerShell/PowerShell/master"
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=mariner
repobased=false
gitscriptname="installpsh-mariner.psh"
gitscriptname="installpsh-mariner.sh"
pwshlink=/usr/bin/pwsh
echo
@ -109,11 +109,11 @@ fi
SUDO=''
if (( EUID != 0 )); then
#Check that sudo is available
if [[ ("'$*'" =~ skip-sudo-check) && ("$(whereis sudo)" == *'/'* && "$(sudo -nv 2>&1)" != 'Sorry, user'*) ]]; then
if [[ ("'$*'" =~ skip-sudo-check) || ("$(whereis sudo)" == *'/'* && "$(sudo -nv 2>&1)" != 'Sorry, user'*) ]]; then
SUDO='sudo'
else
echo "ERROR: You must either be root or be able to use sudo" >&2
#exit 5
exit 5
fi
fi
@ -139,8 +139,8 @@ $SUDO tdnf install -y \
openssh-clients \
ca-certificates \
tar \
curl \
&& tdnf clean all
curl
$SUDO tdnf clean all
##END Check requirements and prerequisites