예제 #1
0
파일: file.py 프로젝트: DawidvC/felix
def _copy_or_move(ctx, src, dst, function, function_name):
    """
    Helper function to simplify copies and moves.
    """

    src = Path(src)
    dst = Path(dst).addroot(ctx.buildroot)

    if not dst.exists():
        # if dst ends with the separator, treat it like a directory
        if dst.endswith(os.sep):
            dst.makedirs()
            dst = dst / src.name
        else:
            dst.parent.makedirs()
    elif dst.isdir():
        # If the dst is a directory, we're just copying that file into that
        # directory.
        dst = dst / src.name

    ctx.logger.check(' * %s' % function_name, '%s -> %s' % (src, dst),
        color='yellow')
    function(src, dst)

    return dst
예제 #2
0
파일: file.py 프로젝트: rjeschmi/fbuild
def _copy_or_move(ctx, src, dst, function, function_name):
    """
    Helper function to simplify copies and moves.
    """

    src = Path(src)
    dst = Path(dst).addroot(ctx.buildroot)

    if not dst.exists():
        # if dst ends with the separator, treat it like a directory
        if dst.endswith(os.sep):
            dst.makedirs()
            dst = dst / src.name
        else:
            dst.parent.makedirs()
    elif dst.isdir():
        # If the dst is a directory, we're just copying that file into that
        # directory.
        dst = dst / src.name

    ctx.logger.check(' * %s' % function_name,
                     '%s -> %s' % (src, dst),
                     color='yellow')
    function(src, dst)

    return dst
예제 #3
0
파일: scala.py 프로젝트: rjeschmi/fbuild
    def __call__(self, dst, srcs, *args, buildroot=None, **kwargs):
        """Run a scala script."""

        dst = Path(dst).addroot(buildroot or self.ctx.buildroot)
        dst.makedirs()

        stdout, stderr = self._run(srcs, *args, dst=dst, **kwargs)
        return dst, stdout, stderr