oasp / oasp4j-ide

tool to automate setup and update of development environment (for Java projects)
Apache License 2.0
14 stars 15 forks source link

console-cygwin.bat not working (cygwin installdir hardcoded) #113

Closed hohwille closed 7 years ago

hohwille commented 7 years ago

The script console-cygwin.bat contains a hardcoded path to the cygwin installation (C:\cygwin64). However, different systems will have cygwin installed in other locations.

IMHO console-cygwin.bat should use the variable %CYGWIN_HOME% instead of the hardcoded path. Further, environment-project.bat should be responsible for determining the cygwin installation and set CYGWIN_HOME (if not already present - e.g. manually set in variables-customized.bat or via system environment variable). Therefore, IMHO the following locations should be considered:

maybeec commented 7 years ago

You are right, basically, I would propose to do it within the console-cygwin.bat as you will not need the CYGWIN_HOME parameter. Otherwise, we should refactor git-bash.bat as well. But neverthless, I am fine with both alternatives.

hohwille commented 7 years ago
@echo off

pushd %~dp0

rem sets the required environment variables like JAVA_HOME, M2_REPO...
call scripts\environment-project.bat

popd

if "%CYGWIN_HOME%" == "" (
  if exist "C:\cygwin\bin\mintty.exe" (
    set CYGWIN_HOME="C:\cygwin"
  )
  if exist "C:\cygwin64\bin\mintty.exe" (
    set CYGWIN_HOME="C:\cygwin64"
  )
  if exist "C:\Program Files (x86)\bin\mintty.exe" (
    set CYGWIN_HOME="C:\Program Files (x86)"
  )
  if exist "C:\Program Files\bin\mintty.exe" (
    set CYGWIN_HOME="C:\Program Files"
  )
  if "%CYGWIN_HOME%" == "" (
    echo "**********************************************"
    echo "************* CYGWIN WAS NOT FOUND ***********"
    echo "* Please install Cygwin to standard location *"
    echo "* or set CYGWIN_HOME to your custom location *"
    echo "**********************************************"
    pause
    exit -1
  )
)
start %CYGWIN_HOME%\bin\mintty.exe -i /Cygwin-Terminal.ico /bin/env CHERE_INVOKING=1 TERMINAL_TITLE=[PNR] /bin/bash -l
maybeec commented 7 years ago

fixed by #119