<commit_before>#!/bin/bash

CD_CMD="cd "\\\"$(pwd)\\\"" && clear"
VERSION=$(sw_vers -productVersion)

if (( $(expr $VERSION '<' 10.7) )); then
	RUNNING=$(osascript<<END
	tell application "System Events"
	    count(processes whose name is "iTerm")
	end tell
END
)
else
	RUNNING=1
fi

if (( $RUNNING )); then
	osascript<<END
	tell application "iTerm"
		activate
		set term to (make new terminal)
		tell term
			set sess to (launch session "Default Session")
			tell sess
				write text "$CD_CMD"
			end tell
		end tell
	end tell
END
else
	osascript<<END
	tell application "iTerm"
		activate
		set sess to the first session of the first terminal
		tell sess
			write text "$CD_CMD"
		end tell
	end tell
END
fi<commit_msg>Ability to open a new Tab in current iTerm window<commit_after>#!/bin/bash

CD_CMD="cd "\\\"$(pwd)\\\"" && clear"
NEWWINDOW=0

while [ "$1" != "" ]; do
	case $1 in
		--openNewWindow )   NEWWINDOW=1
												;;
		--openNewTab )      NEWWINDOW=0
												;;
	esac
	shift
done

if (( $NEWWINDOW )); then
	osascript &>/dev/null <<EOF
	tell application "iTerm"
		set term to (make new terminal)
		tell term
			launch session "Default Session"
			tell the last session
				write text "$CD_CMD"
			end tell
		end tell
	end tell
EOF
else
	osascript &>/dev/null <<EOF
	tell application "iTerm"
		tell current terminal
			launch session "Default Session"
			tell the last session
				write text "$CD_CMD"
			end tell
		end tell
	end tell
EOF
fi

{'fraction_non_alphanumeric': 0.11309115832762166, 'fraction_numerical': 0.00616860863605209, 'mean_word_length': 3.089635854341737, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 5, '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': '3445102', 'n_tokens_mistral': 590, 'n_tokens_neox': 505, 'n_words': 179}