home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cvs1107.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-08-21  |  2KB  |  68 lines

  1. /*
  2. ** $Id: install.cmd,v 1.1.2.3 1998/07/28 11:23:23 ahuber Exp $
  3. **
  4. ** Create a CVS folder and install the reference books.
  5. **
  6. ** Copyright (C) 1998  Andreas Huber <ahuber@ping.at>
  7. **
  8. ** This program is free software; you can redistribute it and/or
  9. ** modify it under the terms of the GNU General Public License
  10. ** as published by the Free Software Foundation; either version 2
  11. ** of the License, or (at your option) any later version.
  12. **
  13. ** This program is distributed in the hope that it will be useful,
  14. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ** GNU General Public License for more details.
  17. **
  18. ** You should have received a copy of the GNU General Public License
  19. ** along with this program; see the file COPYING. If not, write to
  20. ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21. ** Boston, MA 02111-1307, USA.
  22. */
  23. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  24. call SysLoadFuncs
  25.  
  26. EXIT_SUCCESS = 0
  27. EXIT_FAILURE = 1
  28.  
  29. LOCATION = '<CVS_FOLDER>'
  30.  
  31. globals = 'EXIT_SUCCESS EXIT_FAILURE LOCATION'
  32.  
  33. main:
  34.     if arg(1) \= '' then
  35.         install_dir = arg(1)
  36.     else
  37.         install_dir = directory()
  38.     call make_folder 'CVS'
  39.     call make_book install_dir||'\intro.inf',,
  40.         'CVS Introduction'
  41.     call make_book install_dir||'\cvs.inf',,
  42.         'CVS Reference'
  43.     call make_book install_dir||'\cvs-client.inf',,
  44.         'CVS Client/Server Protocol Reference'
  45.     exit EXIT_SUCCESS
  46.  
  47. make_folder: procedure expose (globals) LOCATION
  48.     parse arg title
  49.     if \SysCreateObject('WPFolder', title, '<WP_DESKTOP>',,
  50.             'OBJECTID='||LOCATION, 'update') then
  51.         call die 'Cannot create folder.'
  52.     return
  53.  
  54. make_book: procedure expose (globals) LOCATION
  55.     parse arg name, title
  56.     name = translate(name, '\', '/')
  57.     if \SysCreateObject('WPProgram', title, LOCATION,,
  58.             'PROGTYPE=PM;EXENAME=VIEW.EXE;PARAMETERS='||name,,
  59.              'update') then
  60.         call die 'Cannot create books.'
  61.     return
  62.  
  63. die: procedure expose (globals)
  64.     parse arg text
  65.     call lineout 'stderr:', text
  66.     exit EXIT_FAILURE
  67.  
  68.