Skip to content

Commit

Permalink
Ensure correct line breaks in module footer
Browse files Browse the repository at this point in the history
The different options for the module footers did not have consistent
newline handling:
- modtclfooter & modluafooter did append a line break
- modules_footer (cmdline) did not

Make sure all end with a new line such that they work in combination
especially with the EasyBuild version comment moved to the bottom
  • Loading branch information
Flamefire committed Sep 23, 2024
1 parent ab6c5d8 commit 8a0b143
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,28 +1493,28 @@ def make_module_footer(self):
footer.append(self.make_module_extra_extensions())

# include modules footer if one is specified
if self.modules_footer is not None:
if self.modules_footer:
self.log.debug("Including specified footer into module: '%s'" % self.modules_footer)
footer.append(self.modules_footer)

if self.cfg['modtclfooter']:
if isinstance(self.module_generator, ModuleGeneratorTcl):
self.log.debug("Including Tcl footer in module: %s", self.cfg['modtclfooter'])
footer.extend([self.cfg['modtclfooter'], '\n'])
footer.append(self.cfg['modtclfooter'])
else:
self.log.warning("Not including footer in Tcl syntax in non-Tcl module file: %s",
self.cfg['modtclfooter'])

if self.cfg['modluafooter']:
if isinstance(self.module_generator, ModuleGeneratorLua):
self.log.debug("Including Lua footer in module: %s", self.cfg['modluafooter'])
footer.extend([self.cfg['modluafooter'], '\n'])
footer.append(self.cfg['modluafooter'])
else:
self.log.warning("Not including footer in Lua syntax in non-Lua module file: %s",
self.cfg['modluafooter'])

footer.append(self.module_generator.comment("Built with EasyBuild version %s" % VERBOSE_VERSION))
return ''.join(footer)
return '\n'.join(footer)

def make_module_extend_modpath(self):
"""
Expand Down

0 comments on commit 8a0b143

Please sign in to comment.