#!/bin/bash if ! $IS_CYGWIN; then return fi echo $PATH | grep -q MSBuild if [ -n "$FrameworkVersion" ]; then alias vsshell='echo "FrameworkVersion $FrameworkVersion"' return fi BAT_DIR=~/.local/lib/bat mkdir -p $BAT_DIR VS_SHELL_BAT=$BAT_DIR/vs-env.bat function vsshell { _SHELL=$( cygpath -w -a $VS_SHELL_BAT ) cmd /c "$_SHELL" exit } if [ -f "$VS_SHELL_BAT" ]; then return fi START_MENU="$( cygpath $ProgramData )/Microsoft/Windows/Start Menu/" _PATH=$( find "$START_MENU" -name "*Command Prompt*" | grep "Visual Studio" | grep x64 | grep Native | xargs -I % readshortcut % -r | grep -o "\"\([^\"]\+\)\"" ) echo "@echo off" > "$VS_SHELL_BAT" echo "CALL $_PATH" >> "$VS_SHELL_BAT" echo "START $( where mintty ) -i /Cygwin-Terminal.ico -" >> "$VS_SHELL_BAT"