dalehenrich / filetree

Monticello repository for directory-based Monticello packages enabling the use of git, svn, etc. for managing Smalltalk source code.
https://github.com/CampSmalltalk/Cypress
MIT License
133 stars 26 forks source link

FileTree loading fails if README.md is missing #217

Open peteruhnak opened 7 years ago

peteruhnak commented 7 years ago

https://github.com/dalehenrich/filetree/blob/pharo6.0_dev/repository/MonticelloFileTree-Core.package/MCFileTreeStCypressReader.class/instance/addClassAndMethodDefinitionsFromEntry..st#L8

When README.md is missing in the folder, then classComment will stay uninitialized and then will fail when specifying comment

self addClassDefinitionFrom: classPropertiesDict comment: classComment withSqueakLineEndings.

maybe a fix would be to just add to the beginning of the method classComment := '', or changing the retrieval to soemthing like

classComment := entries
    detect: [ :entry | entry name = 'README.md' ]
    ifFound: [ :commentEntry | commentEntry contents ]
    ifNone: [ '' ].
dalehenrich commented 7 years ago

... the README.md is required ... the creator of the filetree directory structure is supposed to create it correctly ...

peteruhnak commented 7 years ago

well one can run into this issue very easily when e.g. a bad code subdirectory is specified in baseline. And considering the error message is withSqueakLineEndings was sent to nil it is not the most obvious thing to fix. I've ran into this maybe five times this year and every time I see it I am confused for a bit.

So alternative to fixing the code could be providing meaningful error message.

dalehenrich commented 7 years ago

yeah meaningful error message is the ticket ... THX!