Exemplo n.º 1
0
def cmd_init(args):
    i = 0

    if not os.path.exists(CFGDIR):
        i += 1
        os.makedirs(CFGDIR)
        print "Created " + CFGDIR

    if not os.path.exists(TPLDIR):
        i += 1
        os.makedirs(TPLDIR)
        print "Created " + TPLDIR

    check_gitignore()

    if i > 0:
        print "Done."
    else:
        print "Nothing to do."
Exemplo n.º 2
0
def cmd_check_gitignore(cfg, args):
    """
    Provides a way to ensure that at least one line in the .gitignore file for
    the current repository defines the '.gitver' directory in some way.

    This means that even a definition such as "!.gitver" will pass the check,
    but this imply some reasoning has been made before declaring something like
    this.
    """
    if check_gitignore():
        term.out("Your .gitignore file looks fine.")
    else:
        term.out("Your .gitignore file doesn't define any rule for the " +
                 CFGDIRNAME + "\nconfiguration directory: it's recommended to "
                 "exclude it from\nthe repository, unless you know what you "
                 "are doing. If you are not\nsure, add this line to your "
                 ".gitignore file:\n\n    " + CFGDIRNAME + "\n")
Exemplo n.º 3
0
def cmd_check_gitignore(cfg, args):
    """
    Provides a way to ensure that at least one line in the .gitignore file for
    the current repository defines the '.gitver' directory in some way.

    This means that even a definition such as "!.gitver" will pass the check,
    but this imply some reasoning has been made before declaring something like
    this.
    """
    if check_gitignore():
        term.out("Your .gitignore file looks fine.")
    else:
        term.out("Your .gitignore file doesn't define any rule for the " +
                 CFGDIRNAME + "\nconfiguration directory: it's recommended to "
                 "exclude it from\nthe repository, unless you know what you "
                 "are doing. If you are not\nsure, add this line to your "
                 ".gitignore file:\n\n    " + CFGDIRNAME + "\n")