Skip to content

Instantly share code, notes, and snippets.

@SergeStinckwich
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SergeStinckwich/6fe960a6b74ba6257e76 to your computer and use it in GitHub Desktop.
Save SergeStinckwich/6fe960a6b74ba6257e76 to your computer and use it in GitHub Desktop.
Init script for Pharo images using PharoLauncher (adapted from the one of Torsten Bergmann)
| sharedPackageCacheDirectory |
"Never apply to PharoLauncher itself"
(SmalltalkImage current imageName includesSubstring: 'Launcher') ifTrue: [ ^self ].
"ask if script should be applied"
(UIManager default confirm: 'Apply init script from ', StartupPreferencesLoader preferencesGeneralFolder fullName,' to image') ifFalse: [^self ].
"Use a shared package cache to store Monticello MCS files for all images"
sharedPackageCacheDirectory := (StartupPreferencesLoader preferencesGeneralFolder fullName, 'commonpackage-cache') asFileReference
ensureCreateDirectory;
yourself.
MCCacheRepository default directory: sharedPackageCacheDirectory.
"Set password for Squeaksource"
(MCRepositoryGroup default repositories
select: [:each | (each isKindOf: MCHttpRepository)
and: [((each locationWithTrailingSlash includesSubstring: 'www.squeaksource.com')
or: [each locationWithTrailingSlash includesSubstring: 'http://ss3.gemstone.com/ss/'])]
])
do: [:each | each user: 'squeaksourceuser'; password: 'secretsqueaksourcepassword'].
"Set password for SmalltalkHub (hub and HTTP repos)"
(MCRepositoryGroup default repositories
select: [:each |
(each isKindOf: MCSmalltalkhubRepository) and: [each locationWithTrailingSlash includesSubstring: 'smalltalkhub.com']
])
do: [:each | each user: 'PharoUser'; password: 'sthubpassword'].
(MCRepositoryGroup default repositories
select: [:each |
(each isKindOf: MCHttpRepository) and: [each locationWithTrailingSlash includesSubstring: 'smalltalkhub.com']
])
do: [:each | each user: 'PharoUser'; password: 'sthubpassword'].
"Set author name"
Author fullName: 'SergeStinckwich'.
UIManager default inform: 'Script applied'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment