StandaloneStartup.st
changeset 13796 b163498d6e17
parent 13595 c0db78969b83
child 14048 1415c57fee46
equal deleted inserted replaced
13795:f8ee373fcdcf 13796:b163498d6e17
   825     self verboseInfo:('loading patch: ',fileName baseName).
   825     self verboseInfo:('loading patch: ',fileName baseName).
   826     Smalltalk silentFileIn:fileName pathName.
   826     Smalltalk silentFileIn:fileName pathName.
   827 !
   827 !
   828 
   828 
   829 loadPatches
   829 loadPatches
   830     |patchesDir prevMode|
   830     "load all patches in the application's patches dir"
       
   831 
       
   832     self loadPatchesMatching:nil.
       
   833 !
       
   834 
       
   835 loadPatchesMatching:aGlobString
       
   836     "load the patches in the applicazion's patches dir.
       
   837      If aGlobString ist not empty or nil, only patches matching the glob
       
   838      pattern are loaded. E.g. '[0-9]*.chg'"
       
   839 
       
   840     |patchesDir prevMode patchesToLoad|
   831 
   841 
   832     patchesDir := OperatingSystem pathOfSTXExecutable asFilename directory construct:'patches'.
   842     patchesDir := OperatingSystem pathOfSTXExecutable asFilename directory construct:'patches'.
   833     (patchesDir exists and:[patchesDir isDirectory]) ifTrue:[
   843     (patchesDir exists and:[patchesDir isDirectory]) ifTrue:[
   834         prevMode := ClassCategoryReader sourceMode.
   844         prevMode := ClassCategoryReader sourceMode.
   835         ClassCategoryReader sourceMode:#discard.
   845         ClassCategoryReader sourceMode:#discard.
   836         [
   846         [
   837             patchesDir directoryContents sort do:[:eachFilenameString |
   847             patchesToLoad := patchesDir directoryContents.
       
   848             aGlobString notEmptyOrNil ifTrue:[
       
   849                 patchesToLoad := patchesToLoad select:[:eachFilenameString|
       
   850                         aGlobString match:eachFilenameString ignoreCase:true.
       
   851                     ].
       
   852             ].
       
   853             patchesToLoad sort do:[:eachFilenameString |
   838                 self loadPatch:(patchesDir construct:eachFilenameString).
   854                 self loadPatch:(patchesDir construct:eachFilenameString).
   839             ].
   855             ].
   840         ] ensure:[
   856         ] ensure:[
   841             ClassCategoryReader sourceMode:prevMode.
   857             ClassCategoryReader sourceMode:prevMode.
   842         ].
   858         ].
  1136 ! !
  1152 ! !
  1137 
  1153 
  1138 !StandaloneStartup class methodsFor:'documentation'!
  1154 !StandaloneStartup class methodsFor:'documentation'!
  1139 
  1155 
  1140 version
  1156 version
  1141     ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.66 2011-08-18 23:54:49 cg Exp $'
  1157     ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.67 2011-10-25 09:59:14 stefan Exp $'
  1142 !
  1158 !
  1143 
  1159 
  1144 version_CVS
  1160 version_CVS
  1145     ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.66 2011-08-18 23:54:49 cg Exp $'
  1161     ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.67 2011-10-25 09:59:14 stefan Exp $'
  1146 ! !
  1162 ! !
  1147 
  1163 
  1148 StandaloneStartup initialize!
  1164 StandaloneStartup initialize!