#!/bin/bash

baseDir="$( cd "$(dirname "$0")" && pwd )"
cd "$baseDir"

echo "building..."
GOOS=windows go build

dstFile="../../../portmaster-windows-kext/install/MINGW/amd64/winkext-test.exe"
if [[ -d $(dirname "$dstFile") ]]; then
  # make path absolute
  dstFile="$(cd "$(dirname "$dstFile")" && pwd)/$(basename "$dstFile")"
  # copy
  echo "copying to $dstFile"
  cp winkext-test.exe "$dstFile"
else
  echo "not copying to $dstFile (dir does not exist)"
fi
