Don't corrupt IDEA installation if update task has failed

This commit is contained in:
Roman Shevchenko
2013-05-08 10:40:30 +02:00
parent 6f9b36e064
commit 6e4bd53408
2 changed files with 14 additions and 2 deletions
+6
View File
@@ -31,6 +31,7 @@ CD %DEV_IDEA_HOME%
SET ANT_HOME=%DEV_IDEA_HOME%\lib\ant
SET EXEC_ANT="%JAVA_HOME%\bin\java.exe" -Dant.home=%ANT_HOME% -classpath "%ANT_HOME%\lib\ant-launcher.jar" org.apache.tools.ant.launch.Launcher
CALL %EXEC_ANT% -f build/update.xml %*
IF errorlevel 1 GOTO failed
DEL /Q /S %WORK_IDEA_HOME%\lib
DEL /Q /S %WORK_IDEA_HOME%\plugins
@@ -39,5 +40,10 @@ XCOPY %DEV_IDEA_HOME%\bin\win\*.dll %WORK_IDEA_HOME%\bin\ /Q /E /Y
XCOPY %DEV_IDEA_HOME%\bin\win\fsnotifier.exe %WORK_IDEA_HOME%\bin\ /Q /E /Y
XCOPY %DEV_IDEA_HOME%\bin\win\runnerw.exe %WORK_IDEA_HOME%\bin\ /Q /E /Y
XCOPY %DEV_IDEA_HOME%\out\deploy\*.* %WORK_IDEA_HOME%\ /Q /E /Y
GOTO done
:failed
ECHO "Update failed; work IDEA build not modified."
:done
CD /D %WORK_IDEA_HOME%\bin
+8 -2
View File
@@ -11,12 +11,12 @@
if [ ! -f "$WORK_IDEA_HOME/bin/inspect.sh" ]; then
echo "WORK_IDEA_HOME must be defined and point to build you're updating."
exit
exit 1
fi
if [ ! -f "$DEV_IDEA_HOME/build/update.sh" ]; then
echo "DEV_IDEA_HOME must be defined and point to source base you're updating from."
exit
exit 1
fi
echo "Updating $WORK_IDEA_HOME from compiled classes in $DEV_IDEA_HOME"
@@ -26,6 +26,12 @@ ANT_CLASSPATH="$DEV_IDEA_HOME/build/lib/gant/lib/jps.jar"
java -Xms64m -Xmx512m -Dant.home="$ANT_HOME" -classpath "$ANT_HOME/lib/ant-launcher.jar" org.apache.tools.ant.launch.Launcher \
-lib "$ANT_CLASSPATH" -f $DEV_IDEA_HOME/build/update.xml $TARGET
if [ "$?" != "0" ]; then
echo "Update failed; work IDEA build not modified."
rm -rf "$WORK_IDEA_HOME/___tmp___"
exit 2
fi
rm -rf $WORK_IDEA_HOME/lib
rm -rf $WORK_IDEA_HOME/plugins