Skip to content

Commit

Permalink
fixes #301 Create template broken
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Feb 4, 2019
1 parent 2ed7e3c commit d0831e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/PharoLauncher-Core/PhLImage.class.st
Expand Up @@ -226,6 +226,12 @@ PhLImage >> showNativeFolder [
OSPlatform current openFileBrowserOn: file
]

{ #category : #accessing }
PhLImage >> sourcesFile [
^ self file parent files
detect: [ :fileRef | fileRef extension = 'sources' ]
]

{ #category : #printing }
PhLImage >> summaryInfo [
^ String
Expand All @@ -245,6 +251,11 @@ PhLImage >> template [
^ self meta at: #template ifPresent: [ :t | t name ] ifAbsent: [ #unknown ]
]

{ #category : #accessing }
PhLImage >> versionFile [
^ self file parent / PhLVirtualMachineManager imageVersionFileName
]

{ #category : #action }
PhLImage >> vm [
^ (PhLVirtualMachineManager forImage: file pathString) vmFileName
Expand Down
15 changes: 11 additions & 4 deletions src/PharoLauncher-Core/PhLTemplateGroupRepository.class.st
Expand Up @@ -42,10 +42,17 @@ PhLTemplateGroupRepository >> createLocalTemplateNamed: aString [

{ #category : #action }
PhLTemplateGroupRepository >> createZipArchiveFrom: anImage named: aString [
ZipArchive new
addFile: anImage imageFile as: aString , '.image';
addFile: anImage changesFile as: aString , '.changes';
writeToFileNamed: PhLDownloadedTemplateGroup default baseDirectory / aString , 'zip'
| archive |
archive := ZipArchive new.
archive
addFile: anImage imageFile fullName as: aString , '.image';
addFile: anImage changesFile fullName as: aString , '.changes'.
[ archive addFile: anImage sourcesFile fullName as: anImage sourcesFile basename ]
on: NotFound
do: [ :e | "ignore the file" ].
anImage versionFile exists
ifTrue: [ archive addFile: anImage versionFile fullName as: anImage versionFile basename ].
archive writeToFileNamed: (PhLDownloadedTemplateGroup default baseDirectory / aString , 'zip') fullName
]

{ #category : #action }
Expand Down

0 comments on commit d0831e1

Please sign in to comment.