Skip to content

Commit

Permalink
Added main settings file support to "autorun.bat".
Browse files Browse the repository at this point in the history
  • Loading branch information
whitone committed Aug 10, 2007
1 parent 665dc1c commit 3b5d4ac
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions autorun.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rem autorun.bat - Copyright 2007 Stefano Cotta Ramusino.
rem ====================================================
rem Written by Stefano Cotta Ramusino, February 2007.
rem Modified by Stefano Cotta Ramusino, March 2007.
rem Modified by Stefano Cotta Ramusino, August 2007.
rem
rem Based on X.bat - Copyright 2004 Trustees of Indiana University under
rem the GNU General Public License.
Expand Down Expand Up @@ -118,16 +119,24 @@ if not "%2"=="" goto homepass
echo @echo off > "%temp%\lnk\cygwin.bat" 2> nul
%curdrive%\cygwin\bin\cygpath -D -w | %curdrive%\cygwin\bin\sed "s/^\(.*\)/set home=\1\r/" >> "%temp%\lnk\cygwin.bat" 2> nul
call "%temp%\lnk\cygwin.bat" 2> nul
if exist "%home%\cygwineasy.ini" goto myhome
if exist "%curdrive%\cygwineasy.ini" goto defset
echo @echo off > "%temp%\lnk\cygwin.bat" 2> nul
%curdrive%\cygwin\bin\cygpath -D -w | %curdrive%\cygwin\bin\sed "s/^\(.*\)/set home=\1\/cygwin\r/" >> "%temp%\lnk\cygwin.bat" 2> nul
call "%temp%\lnk\cygwin.bat" 2> nul
goto startcyg

:defset
rem Get home directory from main settings file
rem ------------------------------------------
echo @echo off > "%temp%\lnk\cygwin.bat" 2> nul
if exist "%home%\cygwineasy.ini" goto myhome
type "%curdrive%\cygwineasy.ini" | %curdrive%\cygwin\bin\grep -E ^HOME | %curdrive%\cygwin\bin\sed "s/^\(.*\) */set \1/" >> "%temp%\lnk\cygwin.bat" 2> nul
call "%temp%\lnk\cygwin.bat" 2> nul
goto startcyg

:myhome
rem Get home directory from a settings file
rem ---------------------------------------
echo @echo off > "%temp%\lnk\cygwin.bat" 2> nul
type "%home%\cygwineasy.ini" | %curdrive%\cygwin\bin\grep -E ^HOME | %curdrive%\cygwin\bin\sed "s/^\(.*\) */set \1/" >> "%temp%\lnk\cygwin.bat" 2> nul
call "%temp%\lnk\cygwin.bat" 2> nul
goto startcyg
Expand Down

0 comments on commit 3b5d4ac

Please sign in to comment.