def checkdata(url, branch):
    if (os.path.getsize(jsonpath) > 0):
        with open(jsonpath, 'r') as file:
            initdata = json.load(file)
        if (len(initdata) == 0):
            print(f'{logcolors.SUCCESS}Change tree clean{logcolors.ENDC}')
        else:
            filechange.ischanged(url, branch, initbuffer=initdata)
    else:
        print(
            f'{logcolors.ERROR}No changes found from previous session{logcolors.ENDC}'
        )
Example #2
0
def initCommands(info):
    import gitcommands as git
    import filechange
    url, branch = info
    info.remove('n')
    git.init()
    git.createReadme()
    git.add(['.'])
    git.commit(['README.md'])
    git.setBranch(branch)
    git.setremote(url)
    git.push(url, branch)
    print('initial setup done :)')
    filechange.ischanged(url, branch)
def init():
    info = repoInfo.checkinfoInDir()
    url, branch = info
    logger.checkdata(url, branch)
    if ('n' in info):
        initCommands(info)
    else:
        print(
            f'{logcolors.BOLD}Retrieving info from git directory{logcolors.ENDC}'
        )
        print(
            f'{logcolors.CYAN}URL:{logcolors.ENDC} {url} , {logcolors.CYAN}Branch:{logcolors.ENDC} {branch}'
        )
        ischanged(url, branch)
def init():
    info = repoInfo.checkinfoInDir()
    if('n' in info):
        info.remove('n')
        git.init()
        git.createReadme()
        git.add(['.'])
        git.commit(['README.md'])
        git.setBranch(info[1])
        git.setremote(info[0])
        git.push(info[0] , info[1])
        print('initial setup done :)')
        filechange.ischanged(info[0] , info[1])
    else:
        print('Retrieving info from git directory')
        filechange.ischanged(info[0] , info[1])
def init():
    filechange.ischanged()