#!/usr/bin/env elvish

use platform

var pkg_info = (xrepo fetch --json mingw-w64 | from-json)
var mingw_path = $pkg_info[0][artifacts][installdir]

if (eq $platform:os windows) {
  if (eq $E:GITHUB_ACTIONS "true") {
    echo "It is in Github Action"
    set paths = [
      C:/hostedtoolcache/windows/xmake/2.8.5/x64
      $mingw_path/bin
    ]
  } else {
    set paths = [
      ~/scoop/shims/
      $mingw_path/bin
    ]
  }
}

xmake run --yes -vD --group=tests
