home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 563.lha / ToolManager_v1.5 / Scripts / unpack.sh < prev    next >
Text File  |  1991-10-10  |  2KB  |  65 lines

  1. #
  2. #   unpack.sh  -  extract any archive
  3. #
  4. set file $_passed
  5. set dest ram:
  6. # Uncomment the following line if the default destination directory should
  7. # be where the archive came from:
  8. #
  9. # set dest @pathname( $file )
  10.  
  11. alias center "%a echo @center( $a 77 )
  12.  
  13. set w @words( $file )
  14.  
  15. if $w > 2
  16.  center
  17.  center "Wrong usage... click on AppIcon for help"
  18.  return 0
  19. endif
  20.  
  21. if $w = 2
  22.  if -d @word( $file 1 )  # first arg is a directory
  23.   set dest @word( $file 1 )
  24.   set file @word( $file 2 )
  25.  else
  26.   set dest @word( $file 2 )
  27.   set file @word( $file 1 )
  28.  endif
  29. endif
  30.  
  31. if $file <> ""
  32.  class.sh toolmanager
  33.  cd $dest
  34.  action extr $file
  35.  set err $_lasterr
  36.  if $err = 10
  37.   center
  38.   center "I could not determine the type of this file."
  39.  endif
  40.  if $err = 11
  41.   center
  42.   center "I don't know how to unpack this type of file."
  43.  endif
  44.  if $err = 12
  45.   center
  46.   center "I could not execute the program to unpack this file."
  47.  endif
  48. else
  49.  center
  50.  center "* * *  UNPACK  * * *"
  51.  center
  52.  center "If you drop any archive on this icon, it will be unpacked to RAM:.
  53.  center "To specify a destination directory, click on the destination"
  54.  center "drawer/disk, and shift-drag the archive icon on the unpack icon."
  55.  center
  56.  center "You have to select 'Update' from the workbench's 'Window' menu to
  57.  center "see the new files if the destination drawer was already open.
  58.  center
  59.  center "To modify the various programs used for unarchiving, read
  60.  center "the chapter 'object oriented features' in your csh.doc.
  61.  center
  62.  center
  63.  center "Click close button when done
  64. endif
  65.