Downloading the gt4gemstone release

Every Glamorous Toolkit release has an associated gt4gemstone release containing the code that needs to be loaded into GemStone. This is an archive file attached to the release, named gt4gemstone-3.7.zip.

Dowloading the latest release from the command line

The current release of Glamorous Toolkit can be obtained from the GitHub API.

GT_VERSION=$(curl -s https://api.github.com/repos/feenkcom/gtoolkit/releases/latest | grep tag_name | cut -d '"' -f 4)

Afterwards the gt4gemstone code can be downloaded from the release tag.

curl -LO https://github.com/feenkcom/gtoolkit/releases/download/${GT_VERSION}/gt4gemstone-3.7.zip

Dowloading the gt4gemstone release associated with the image

If the image corresponds to a Glamorous Toolkit release, the image stores the release version.

That can be used to download the corresponding gt4gemstone release.

releaseVersion := GtImage version versionString.
(releaseVersion beginsWith: 'DEV ') ifTrue:
	[ releaseVersion := releaseVersion copyFrom: 5 to: releaseVersion size ].
releaseVersion.
  
targetFolder := (FileLocator imageDirectory / 
	'gt4gemstone') asFileReference ensureCreateDirectory.
  
| releaseArchiveName releaseUrl znClient |
releaseArchiveName := 'gt4gemstone-3.7.zip'. 
releaseUrl:='https://github.com/feenkcom/gtoolkit/releases/download/{1}/'
	format: {releaseVersion}. 

(targetFolder / releaseArchiveName) exists ifFalse: [
	znClient := ZnClient new
		url: releaseUrl, releaseArchiveName;
		signalProgress: true.
	(znClient downloadTo: targetFolder) ifFalse:
		[ self error: 'Unable to retrieve archive' ] ].

targetFolder