<commit_before>#!/bin/bash

if [ $# -eq 0 ]; then
	echo "No arguments supplied."
	echo "Usage: # install.sh <projectName>"
	exit 1
fi

if [[ $EUID -ne 0 ]]; then
	echo "This script must be run as root."
	exit 1
fi

projectName=$1
projectPath=/var/www/html/$projectName

if [ -d $projectPath ]; then
	echo "Error. The project directory already exists at $projectPath"
	echo ""
	echo "\
Are you reinstalling? If so, remove the current installation using clean.sh\
then try again."
	exit 1
fi

mkdir $projectPath
# HTML.
cp index.html $projectPath
# JS.
cp script.js $projectPath
# PHP.
cp -R php $projectPath
# Other.
cp -R thirdparty/ $projectPath

# Create the database.
touch $projectPath/user.db
mkdir $projectPath/userdata
# Make it writeable to the server's PHP scripts (all users).
chmod a+w $projectPath/user.db
chmod a+w $projectPath/userdata
chmod +777 $projectPath
<commit_msg>Make project dir writeable to apache not all users<commit_after>#!/bin/bash

if [ $# -eq 0 ]; then
	echo "No arguments supplied."
	echo "Usage: # install.sh <projectName>"
	exit 1
fi

if [[ $EUID -ne 0 ]]; then
	echo "This script must be run as root."
	exit 1
fi

projectName=$1
projectPath=/var/www/html/$projectName

if [ -d $projectPath ]; then
	echo "Error. The project directory already exists at $projectPath"
	echo ""
	echo "\
Are you reinstalling? If so, remove the current installation using clean.sh\
then try again."
	exit 1
fi

mkdir $projectPath
# HTML.
cp index.html $projectPath
# JS.
cp script.js $projectPath
# PHP.
cp -R php $projectPath
# Other.
cp -R thirdparty/ $projectPath

# Create the database.
touch $projectPath/user.db
mkdir $projectPath/userdata
# Make it writeable to the server's PHP scripts.
sudo chown -R www-data $projectPath

{'fraction_non_alphanumeric': 0.10882016036655212, 'fraction_numerical': 0.00859106529209622, 'mean_word_length': 3.907303370786517, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, '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': '1811742', 'n_tokens_mistral': 606, 'n_tokens_neox': 575, 'n_words': 226}