Skip to content

Does not work on windows #13

@tbutler-qontigo

Description

@tbutler-qontigo

Hi
Trying to use this in a github action on windows-latest it fails due to lack of sudo:

VERSION=0.3.0
  DESTDIR=D:\a\devops-gh-actions\devops-gh-actions/_buildtools/bats/1.11.0/bats-support
  TEMPDIR="/tmp/bats-support"
  url="[https://github.com/bats-core/bats-support/archive/refs/tags/v${VERSION}.tar.gz](https://github.com/bats-core/bats-support/archive/refs/tags/v$%7BVERSION%7D.tar.gz)"
  
  mkdir -p ${TEMPDIR}
  [[ "${DESTDIR}" == "$HOME"* ]] && CMD="" || CMD="sudo"
  ${CMD} mkdir -p ${DESTDIR}/src/
  curl -sL ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
  # Archlinux style, except that we are not in a fakeroot env
  ${CMD} install -Dm755 load.bash ${DESTDIR}/load.bash
  for fn in src/*.bash; do
    ${CMD} install -Dm755 $fn \
       ${DESTDIR}/src/$(basename $fn)
  done
  echo "Bats Support v$VERSION installed in $DESTDIR"
  echo "support-installed=true" >> $GITHUB_OUTPUT
  # Cleanup bats-support if required
  [[ "true" = "true"  ]] && rm -rf ${TEMPDIR} || exit 0
  shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
D:\a\_temp\f5e99e24-da2b-4206-a0ee-ba2419854757.sh: line 8: sudo: command not found

I am installing in ${{ github.workspace }}/_buildtools/bats-support

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions