package.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:redcap_deployment 作者: ctsit 项目源码 文件源码
def deploy_hooks_into_build_space(target_within_build_space="redcap/hooks/library"):
    """
    Deploy each extension into build space by running its own deploy.sh.
    Lacking a deploy.sh, copy the extension files to the build space.
    For each extension run test.sh if it exists.
    """
    # make sure the target directory exists
    extension_dir_in_build_space='/'.join([env.builddir, target_within_build_space])
    with settings(warn_only=True):
        if local("test -d %s" % extension_dir_in_build_space).failed:
            local("mkdir -p %s" % extension_dir_in_build_space)

    # For each type of hook, make the target directory and deploy its children
    for feature in os.listdir(env.hooks_deployment_source):
        # make the target directory
        feature_fp_in_src = '/'.join([env.hooks_deployment_source, feature])
        if os.path.isdir(feature_fp_in_src):
            # file is a hook type
            feature_fp_in_target = extension_dir_in_build_space
            if not os.path.exists(feature_fp_in_target):
                os.mkdir(feature_fp_in_target)

            deploy_extension_to_build_space(feature_fp_in_src, feature_fp_in_target)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号