home *** CD-ROM | disk | FTP | other *** search
- " Load scripts on a specific path given in lobby searchPath "
- " By Michael Richardson <mcr@sandelman.ocunix.on.ca> "
- " Modified by Danny Epstein for to be compatible with Self 1.3 beta "
- " Version 1 "
- " For Self 1.3 beta "
- "
- * $Id: loadscript.self,v 1.1 1993/05/03 19:17:32 richards Exp richards $
- *
- * $Log: loadscript.self,v $
- # Revision 1.1 1993/05/03 19:17:32 richards
- # Initial revision
- #
- *
- "
-
- "Note that _OpenMode searches relative to the directory containing the
- snapshot whereas _RunScript searches relative to the SELFDIR
- environment variable. This code assumes that SELFDIR is
- ~/self1.3-beta/source and that the snapshot is in ~/self1.3-beta.
- Also, _OpenMode assumes the full filname is specified, whereas
- _RunScript adds the '.self' suffix itself if it is left out. This
- code also assumes that all Self files use the '.self' suffix."
-
- _AddSlotsIfAbsent: ( | _ filein* = () | )
- filein _Define: ( |
- ^ searchPath <- list copy.
- ^ loadVerbose <- false.
- ^ load = (
- searchPath do: [ | :aDir. fullname. |
- fullname: aDir, self ,'.self'.
- loadVerbose ifTrue: [ ('Testing for ',fullname) printLine. ].
- (unixFile exists: fullname) ifTrue: [
- loadVerbose ifTrue: [('Loading script: ', fullname) printLine].
- ^ fullname canonicalize _RunScript.
- ].
- ].
- searchPath do: [ | :aDir. fullname. |
- fullname: aDir, self.
- loadVerbose ifTrue: [ ('Testing for ',fullname) printLine. ].
- (unixFile exists: fullname) ifTrue: [
- loadVerbose ifTrue: [('Loading script: ',fullname) printLine].
- ^ fullname canonicalize _RunScript.
- ].
- ].
- ('\'', self, '\' not found in searchPath.') printLine.
- 'File not loaded.' printLine.
- nil
- ).
- | )
-
- searchPath addLast: '' "~/self/" "temporary changes"
- searchPath addLast: 'mcrhack/' "~/self/mcrhack/" "local hacks"
- searchPath addLast: 'changes/' "~/self/changes/" "changes"
-
-