Changeset 1919


Ignore:
Timestamp:
4/16/2010 7:07:27 AM (5 years ago)
Author:
lowjoel
Message:

Use exit instead of die when in the CLI since we need to return error codes to the calling program.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/website/scripts/BuildPublish.php

    r1917 r1919  
    88 
    99if (count($argv) < 4) 
    10     die('There are insufficient arguments for BuildPublish.php.' . "\n\n" . 'Usage: BuildPublish.php <branch name> <revision> <installer>'); 
     10{ 
     11    echo 'There are insufficient arguments for BuildPublish.php.' . "\n\n" . 
     12        'Usage: BuildPublish.php <branch name> <revision> <installer>'; 
     13    exit(1); 
     14} 
    1115 
    1216require_once('Credentials.php'); 
     
    5862$file = fopen($argv[3], 'rb'); 
    5963if (!$file) 
    60     die('The file ' . $argv[3] . ' could not be opened for reading.'); 
     64{ 
     65    echo 'The file ' . $argv[3] . ' could not be opened for reading.'; 
     66    exit(1); 
     67} 
    6168 
    6269try 
     
    6572    $branches = BuildBranch::Get(); 
    6673    if (!array_key_exists($argv[1], $branches)) 
    67         die('The branch ' . $argv[1] . ' does not exist.'); 
     74        throw new Exception('The branch ' . $argv[1] . ' does not exist.'); 
    6875 
    6976    define('SHELL_WEB_ROOT', 'sftp://web.sourceforge.net/home/groups/e/er/eraser/htdocs'); 
     
    103110catch (Exception $e) 
    104111{ 
    105     die($e->getMessage()); 
     112    echo $e->getMessage(); 
     113    exit(1); 
    106114} 
    107115 
Note: See TracChangeset for help on using the changeset viewer.