<commit_before>#tool "nuget:https://api.nuget.org/v3/index.json?package=Wyam&version=1.4.1"
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Wyam&version=1.4.1"
#addin "Cake.Npm"

DirectoryPath   outputPath = MakeAbsolute(Directory("./output"));
string          target     = Argument("target", "Generate-Blog"),
                baseUri    = EnvironmentVariable("KUDU_CLIENT_BASEURI"),
                userName   = EnvironmentVariable("KUDU_CLIENT_USERNAME"),
                password   = EnvironmentVariable("KUDU_CLIENT_PASSWORD");

Task("Clean-Blog")
    .Does(() =>
{
    CleanDirectory(outputPath);
});

Task("Generate-Blog")
    .IsDependentOn("Clean-Blog")
    .Does(() =>
{
    Wyam(new WyamSettings
    {
        Recipe = "Blog",
        Theme = "CleanBlog",
        OutputPath = outputPath
    });
});

Task("Kudu-Publish-Blog")
    .IsDependentOn("Generate-Blog")
    .WithCriteria(!string.IsNullOrEmpty(baseUri)
        && !string.IsNullOrEmpty(userName)
        && !string.IsNullOrEmpty(password)
    )
    .Does(()=>
{
    IKuduClient kuduClient = KuduClient(
        baseUri,
        userName,
        password);

    kuduClient.ZipDeployDirectory(
        outputPath);
});

Task("Deploy")
    .Does(() =>
    {
        // Add NETLIFY_TOKEN to your enviornment variables
        string token = EnvironmentVariable("NETLIFY_TOKEN");
        if(string.IsNullOrEmpty(token))
        {
            throw new Exception("Could not get NETLIFY_TOKEN environment variable");
        }

        // zip the output directory and upload using curl<commit_msg>Clean up cake file<commit_after>#tool "nuget:https://api.nuget.org/v3/index.json?package=Wyam&version=1.4.1"
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Wyam&version=1.4.1"

DirectoryPath   outputPath = MakeAbsolute(Directory("./output"));
string          target     = Argument("target", "Generate-Blog");

Task("Clean-Blog")
    .Does(() =>
{
    CleanDirectory(outputPath);
});

Task("Generate-Blog")
    .IsDependentOn("Clean-Blog")
    .Does(() =>
{
    Wyam(new WyamSettings
    {
        Recipe = "Blog",
        Theme = "CleanBlog",
        OutputPath = outputPath
    });
});

Task("Deploy")
    .Does(() =>
    {
        // Add NETLIFY_TOKEN to your enviornment variables
        string token = EnvironmentVariable("NETLIFY_TOKEN");
        if(string.IsNullOrEmpty(token))
        {
            throw new Exception("Could not get NETLIFY_TOKEN environment variable");
        }

        // zip the output directory and upload using curl
{'fraction_non_alphanumeric': 0.14375738479716424, 'fraction_numerical': 0.006301693580149665, 'mean_word_length': 2.808095952023988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 4, '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': '162540', 'n_tokens_mistral': 819, 'n_tokens_neox': 812, 'n_words': 130}