<commit_before>	#! /usr/bin/env python

import config
import os
from subprocess_helper import getCmd

NAME="init"
HELP="give git issues"

class Args:
	"""Wrapper class that defines the command line args"""
	OPT_GHI_PATH="--ghi_path"
	OPT_GHI_PATH_HELP="Path to ghi install"

def execute(args):
	# Check to see if the .ghi directories have already been created
	# If it doesn't exist, create it.
	if os.path.isdir(config.GHI_DIR) == False:
		os.makedirs(config.GHI_DIR)
		os.makedirs(config.ISSUES_DIR)
	elif os.path.isdir(config.ISSUES_DIR) == False:
		os.makedirs(config.ISSUES_DIR)
	else:
		print "This git already has issues."
		
	# Alias "git issue" to ghi
	if (args.ghi_path):
		getCmd("git config alias.issue '!" + args.ghi_path + "'")
	else:
		getCmd("git config alias.issue '!ghi'")<commit_msg>init now writes the ghi .gitignore file as well<commit_after>	#! /usr/bin/env python

import config
import os
from subprocess_helper import getCmd

NAME="init"
HELP="give git issues"

class Args:
	"""Wrapper class that defines the command line args"""
	OPT_GHI_PATH="--ghi_path"
	OPT_GHI_PATH_HELP="Path to ghi install"

def execute(args):
	# Check to see if the .ghi directories have already been created
	# If it doesn't exist, create it.
	if os.path.isdir(config.GHI_DIR) == False:
		os.makedirs(config.GHI_DIR)
		os.makedirs(config.ISSUES_DIR)
		
		_writeGhiDirGitIgnoreFile(config.GHI_DIR + "/.gitignore")

	elif os.path.isdir(config.ISSUES_DIR) == False:
		os.makedirs(config.ISSUES_DIR)

	# Alias "git issue" to ghi
	if (args.ghi_path):
		getCmd("git config alias.issue '!" + args.ghi_path + "'")
	else:
		getCmd("git config alias.issue '!ghi'")

def _writeGhiDirGitIgnoreFile(filepath):
	with open(filepath, 'wb') as f:
		f.write("ISSUE_EDIT\n")
	f.close()
{'fraction_non_alphanumeric': 0.12514156285390712, 'fraction_numerical': 0.0, 'mean_word_length': 4.627388535031847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '191814', 'n_tokens_mistral': 699, 'n_tokens_neox': 671, 'n_words': 173}