@echo off REM --------------------------------------------------------------------------- REM agetpref.bat - Don Cross - https://cosinekitty.com REM Utility batch file used by abuild.bat and aupload.bat. REM This batch file parses the Arduino preferences.txt file. set rc=1 if not "%1" == "agetpref_internal" ( echo. echo.This batch file is designed for use by abuild.bat and aupload.bat. echo. echo.This batch file was released on 7 January 2007. echo.Check the following web page for the latest version: echo. echo. https://playground.arduino.cc/Code/WindowsCommandLine echo. goto end ) REM --------------------------------------------------------------------------- REM Slurp in all Arduino preferences as environment variables... if not defined appdata ( echo.The environment variable APPDATA must be defined. echo.Example: APPDATA=c:\Documents and Settings\yourname\Application Data goto end ) set preffile=%appdata%\arduino\preferences.txt if not exist "%preffile%" ( echo.Could not find file "%preffile%" echo.Maybe Arduino is not installed properly? goto end ) pushd "%appdata%\arduino\" for /f %%x in (preferences.txt) do ( set pref_%%x ) popd REM --------------------------------------------------------------------------- REM Check for any necessary variables being missing... for %%x in ( build.f_cpu build.mcu serial.download_rate upload.programmer ) do ( if not defined pref_%%x ( echo.Missing %%x in file "%preffile%" goto end ) if "%abuild_verbose%" == "true" ( echo.agetpref.bat: %%x=!pref_%%x! ) ) REM --------------------------------------------------------------------------- REM Success! set rc=0 goto end REM --------------------------------------------------------------------------- :end exit /b %rc% REM --------------------------------------------------------------------------- REM $Log: agetpref.bat,v $ REM Revision 1.4 2007/01/07 22:53:53 dcross REM Usage text now displays link to where to get latest version on Arduino Playground. REM Also displays its own release date so user can tell whether what he has is up-to-date. REM REM Revision 1.3 2007/01/07 22:42:51 dcross REM Sorted the preferences in alphabetical order. Let's keep them that way for easy maintenance. REM REM Revision 1.2 2007/01/07 22:31:38 dcross REM Added cvs log tag. REM