Author: cfinck
Date: Wed Nov 21 18:40:40 2007
New Revision: 30626
URL:
http://svn.reactos.org/svn/reactos?rev=30626&view=rev
Log:
Simplify scut.cmd, remove much duplicated code
Modified:
trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd
Modified: trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/scu…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd Wed Nov 21 18:40:40 2007
@@ -3,63 +3,35 @@
:: LICENSE: GPL - See LICENSE.txt in the top level directory.
:: FILE: Root/scut.cmd
:: PURPOSE: Manages named shortcuts to ReactOS source directories.
-:: COPYRIGHT: Copyright 2007 Daniel Reimer <reimer.daniel(a)freenet.de>
+:: COPYRIGHT: Copyright 2007 Colin Finck <mail(a)colinfinck.de>
+:: Daniel Reimer <reimer.daniel(a)freenet.de>
:: Peter Ward <dralnix(a)gmail.com>
::
@echo off
-if /i "%1" == "" (
- for /f "usebackq tokens=*" %%i in
(`"%_ROSBE_BASEDIR%\Tools\scut.exe"`) do (
- if /i not "%%i" == "Default" (
- cd /d %%i
- set _ROSBE_ROSSOURCEDIR=%%i
- )
- )
- goto :EOC
+:: Check if the parameter is an scut parameter, which can just be forwarded to the EXE
file
+if /i "%1" == "add" goto paramcall
+if /i "%1" == "rem" goto paramcall
+if /i "%1" == "edit" goto paramcall
+if /i "%1" == "def" goto paramcall
+if /i "%1" == "list" goto paramcall
+if /i "%1" == "/?" goto paramcall
+if /i "%1" == "-h" goto paramcall
+if /i "%1" == "--help" goto paramcall
+
+:: It's a shortcut name, so change the directory
+for /f "usebackq tokens=*" %%i in
(`""%_ROSBE_BASEDIR%\Tools\scut.exe" %*"`) do (
+ if /i not "%%i" == "Default" (
+ if exist "%%i\." (
+ cd /d %%i
+ set _ROSBE_ROSSOURCEDIR=%%i
+ )
+ )
)
-if /i "%1" == "add" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "rem" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "edit" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "def" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "list" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "/?" (
- "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "-h" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if /i "%1" == "--help" (
- call "%_ROSBE_BASEDIR%\Tools\scut.exe" %*
- goto :EOC
-)
-if not "%1" == "" (
- for /f "usebackq tokens=*" %%i in
(`""%_ROSBE_BASEDIR%\Tools\scut.exe" %*"`) do (
- if /i not "%%i" == "Default" (
- if exist "%%i\." (
- cd /d %%i
- set _ROSBE_ROSSOURCEDIR=%%i
- )
- )
- )
- goto :EOC
-)
+goto :EOC
+
+:paramcall
+"%_ROSBE_BASEDIR%\Tools\scut.exe" %*
:EOC
title ReactOS Build Environment %_ROSBE_VERSION%