<commit_before>#!/bin/sh
# Update dotfiles from GitHub tarball

# Exit on any command failures
set -e

# Extract GitHub username from gitconfig-user
GITHUB_USERNAME=$(grep "user =" gitconfig-user | sed -e 's/.*user = //')

DOTFILESDIRREL=$(dirname $0)
cd $DOTFILESDIRREL
if [ -e .git ]
then
	echo "This dotfiles directory was checked out from Git so I won't update it."
	echo "If you want it updated from a tarball anyway, please delete .git first."
	exit 1
fi

OUTFILE="dotfiles.tar.gz"
which curl &>/dev/null && DOWNLOAD="curl --progress-bar --location --output $OUTFILE"
[ -z "$DOWNLOAD" ] && which wget &>/dev/null && DOWNLOAD="wget --output-document=$OUTFILE"
[ -z "$DOWNLOAD" ] && echo "Could not find curl or wget" && exit 1

$DOWNLOAD https://github.com/$GITHUB_USERNAME/dotfiles/archive/master.tar.gz
tar --strip-components=1 -z -x -v -f dotfiles.tar.gz
rm dotfiles.tar.gz<commit_msg>Fix GitHub tarball location.<commit_after>#!/bin/sh
# Update dotfiles from GitHub tarball

# Exit on any command failures
set -e

# Extract GitHub username from gitconfig-user
GITHUB_USERNAME=$(grep "user =" gitconfig-user | sed -e 's/.*user = //')

DOTFILESDIRREL=$(dirname $0)
cd $DOTFILESDIRREL
if [ -e .git ]
then
	echo "This dotfiles directory was checked out from Git so I won't update it."
	echo "If you want it updated from a tarball anyway, please delete .git first."
	exit 1
fi

OUTFILE="dotfiles.tar.gz"
which curl &>/dev/null && DOWNLOAD="curl --progress-bar --location --output $OUTFILE"
[ -z "$DOWNLOAD" ] && which wget &>/dev/null && DOWNLOAD="wget --output-document=$OUTFILE"
[ -z "$DOWNLOAD" ] && echo "Could not find curl or wget" && exit 1

$DOWNLOAD https://nodeload.github.com/$GITHUB_USERNAME/dotfiles/tar.gz/master
tar --strip-components=1 -z -x -v -f $OUTFILE
rm $OUTFILE
{'fraction_non_alphanumeric': 0.14373601789709173, 'fraction_numerical': 0.0044742729306487695, 'mean_word_length': 3.9832869080779942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6249267', 'n_tokens_mistral': 628, 'n_tokens_neox': 604, 'n_words': 204}