<commit_before>﻿#minify.ps1
#From github.com/tom-engel/website-minifier/
#Copyright (c) 2015 tom-engel under MIT-License
#See LICENSE for further details.
#
#Minification of html, CSS and JavaScript-files using
#htmlcompressor [https://code.google.com/p/htmlcompressor/]
#and
#yuicompressor [http://yui.github.io/yuicompressor/]

#Path to htmlcompressor
$html = "C:\jars\htmlcompressor-x.x.x.jar"

#Path to yuicompressor
$yui = "C:\jars\yuicompressor-x.x.x.jar"

#Path to output folder
$out ="./min"

#Paths to html-containing folders
$htmlFolders = "./"

#Paths to CSS-containing folders
$cssFolders = "./css"

#Paths to js-containing folders
$jsFolders = "./js"

#Paths to CSS-files
$cssFiles = "$cssFolders/style.css"

#Paths to js-Files
$jsFiles = "$jsFolders/script.js"

#Check if out-folders exist. If not, create them
if (-Not (Test-Path $out)) {
    mkdir $out
}

foreach($folder in $htmlFolders) {
    if (-Not (Test-Path $out/$folder)) {
        mkdir $out/$folder
    }
}

foreach($folder in $cssFolders) {
    if (-Not (Test-Path $out/$folder)) {
        mkdir $out/$folder
    }
}

foreach($folder in $jsFolders) {
    if (-Not (Test-Path $out/$folder)) {
        mkdir $out/$folder
    }
}

# Compress HTML
foreach($folder in $htmlFolders) {
    java -jar $html $folder -o $out/$folder
}

# Compress CSS
foreach($file in $cssFiles) {
    java -jar $yui -o $out/$file $file<commit_msg>Checking folders is now a function<commit_after>﻿# minify.ps1
# From github.com/tom-engel/website-minifier/
# Copyright (c) 2015 tom-engel under MIT-License
# See LICENSE for further details.
#
# Minification of html, CSS and JavaScript-files using
# htmlcompressor [https://code.google.com/p/htmlcompressor/]
# and
# yuicompressor [http://yui.github.io/yuicompressor/]

# Variables
# Path to htmlcompressor
$html = "C:\jars\htmlcompressor-x.x.x.jar"

# Path to yuicompressor
$yui = "C:\jars\yuicompressor-x.x.x.jar"

# Path to output folder
$out ="./min"

# Paths to html-containing folders
$htmlFolders = "./"

# Paths to CSS-containing folders
$cssFolders = "./css"

# Paths to js-containing folders
$jsFolders = "./js"

# Paths to CSS-files
$cssFiles = "$cssFolders/style.css"

# Paths to js-Files
$jsFiles = "$jsFolders/script.js"

# Functions
# Check if out-folders exist. If not, create them
# IN: $folders: Array with folders / folder
# IN: $out: path to output folder
Function CheckFolders($folders, $out) {

  foreach($folder in $folders) {
    if (-Not (Test-Path $out/$folder)) {
        mkdir $out/$folder
    }
  }
}

# Check out-folder
if (-Not (Test-Path $out)) {
    mkdir $out
}

# Check other folders
CheckFolders $htmlFolders $out
CheckFolders $cssFolders  $out
CheckFolders $jsFolders   $out

# Compress HTML
foreach($folder in $htmlFolders) {
    java -jar $html $folder -o $out/$folder
}

# Compress CSS
foreach($file in $cssFiles) {
    java -jar $yui -o $out/$file $file
{'fraction_non_alphanumeric': 0.14759764949879017, 'fraction_numerical': 0.0034566194262011752, 'mean_word_length': 3.652733118971061, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4836916', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1074, 'n_words': 282}