simple.cmd #2

  • //
  • guest/
  • jeff_bowles/
  • perforce-triggers/
  • simple.cmd
  • View
  • Commits
  • Open Download .zip Download (712 B)
@echo off
::
:: This is the simplest NT command script, write checks that "Bug:"
:: appears in a changelist description.
::
:: It's included as an example, and is a good SMALL example that's
:: used in the most recent Perforce classes on machines that might
:: not have perl or a C compiler or python.
:: 
:: Run this script with the changelist number as the only argument.
:: Note that if there are multiple servers, it'll connect to a default
:: and not necessarily the one that ran this script.

if "%1" == "" goto error

:start
p4 describe %1 | findstr "Bug:"
if errorlevel 1 goto error

:done
goto end

::
:: run a non-existent command, to give a 'failing' exit code.
::
:error
garbagecommand 2>NULL:

:end
# Change User Description Committed
#3 105 Jeff Bowles deleting original names, in order to match the 'utils' area.
#2 100 Jeff Bowles Taking Fanny's comments (on the comments) into account.
#1 99 Jeff Bowles Adding Jo's classroom example using an NT command file as a trigger.