Last active
August 29, 2015 14:04
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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