Unverified Commit 224c3007 authored by Stanisław Pitucha's avatar Stanisław Pitucha Committed by GitHub
Browse files

gradle: Check that mitmCache.updateScript is run from a valid location (#486373)

parents 9613a38b 2b564349
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -101,6 +101,12 @@ lib.makeOverridable (
          "${dirOf pkg.meta.position}/${data}"
      }"

      # Check that the parent directory exists before running more costly tasks
      if [ ! -d $(dirname "$outPath") ]; then
        echo "Directory \"$(dirname "$outPath")\" does not exist, aborting as the next steps would fail anyway"
        exit 1
      fi

      pushd "$(mktemp -d)" >/dev/null
      MITM_CACHE_DIR="$PWD"
      trap "rm -rf '$MITM_CACHE_DIR'" SIGINT SIGTERM ERR EXIT