How to use the tmt.createSymlinkIfNotExistsOrStale function in tmt

To help you get started, we’ve selected a few tmt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thewca / tnoodle / winstone / tmtproject.py View on Github external
assert self.webContent
                    for dirpath, dirnames, filenames in os.walk(self.webContent):
                        dirnames[:] = list(filter(notDotfile, dirnames)) # Note that we're modifying dirnames in place

                        if "WEB-INF" in dirnames:
                            dirnames.remove("WEB-INF")
                        for filename in filter(notDotfile, filenames):
                            path = os.path.normpath(os.path.join(dirpath, filename))
                            pathRelToWebContent = relpath(path, self.webContent)
                            name = join(tmt.WinstoneServer.binResource, "webapps", "ROOT", pathRelToWebContent)
                            linkParent = os.path.dirname(name)
                            if not os.path.exists(linkParent):
                                os.makedirs(linkParent)
                            else:
                                assert os.path.isdir(linkParent)
                            tmt.createSymlinkIfNotExistsOrStale(relpath(path, linkParent), name)
                    tmt.WinstoneServer.mungeXmlFiles(topLevelWebProject=self)
            return newCompile