예제 #1
0
            package, version = package.split('@', 1)

        name = path.splitext(path.basename(package))[0]
        type = 'git'
    else:
        package = path.abspath(package)
        name = path.basename(package)

    safe_name = re.sub(r'[^a-zA-Z0-1-_]', '_', name)

    return package, safe_name, version, type


@app.command(opts=(app.opt('-u',
                           '--upgrade',
                           action='store_true',
                           dest='upgrade',
                           help='Force upgrade of installed package')),
             usage='[options] [PACKAGE] [PACKAGE...]')
def install(args, console, env, ciprcfg, opts):
    """
    Install a package from github and make it available for use.
    """
    if len(args) == 0:
        # Is this a cipr project?
        if ciprcfg.exists:
            # Install all the packages for this project
            console.quiet('Installing current project packages...')
            for name, source in ciprcfg.packages.items():
                if opts.upgrade:
                    app.command.run(['install', '--upgrade', source])
예제 #2
0
파일: core.py 프로젝트: jong/corona-cipr
    type = 'dir'
    if package.startswith('git'):
        if '@' in package:
            package, version = package.split('@', 1)

        name = path.splitext(path.basename(package))[0]
        type = 'git'
    else:
        package = path.abspath(package)
        name = path.basename(package)

    return package, name, version, type


@app.command(
    opts=(app.opt('-u', '--upgrade', action='store_true', dest='upgrade', help='Force upgrade of installed package')),
    usage='[options] [PACKAGE] [PACKAGE...]'
)
def install(args, console, env, ciprcfg, opts):
    """
    Install a package from github and make it available for use.
    """
    if len(args) == 0:
        # Is this a cipr project?
        if ciprcfg.exists:
            # Install all the packages for this project
            console.quiet('Installing current project packages...')
            for name, source in ciprcfg.packages.items():
                if opts.upgrade:
                    app.command.run(['install', '--upgrade', source])
                else: