<commit_before>module.exports = function(ctx) {
    var fs = ctx.requireCordovaModule('fs'),
        path = ctx.requireCordovaModule('path'),
        os = require("os"),
        readline = require("readline"),
        deferral = ctx.requireCordovaModule('q').defer();

    var platformRoot = path.join(ctx.opts.projectRoot, 'www');
    var settingsFile = path.join(platformRoot, 'google-services.json');

    fs.stat(settingsFile, function(err,stats) {
        if (err) {
            deferral.reject("To use this plugin on android you'll need to add a google-services.json file with the FCM project_info and place that into your www folder");
        } else {

            fs.createReadStream(settingsFile).pipe(fs.createWriteStream('platforms/android/google-services.json'));

            var lineReader = readline.createInterface({
                input : fs.createReadStream('platforms/android/build.gradle')
            });
            lineReader.on("line", function(line) {
                fs.appendFileSync('./build.gradle', line.toString() + os.EOL);
                if (/.*\ dependencies \{.*/.test(line)) {
                    fs.appendFileSync('./build.gradle', '\t\tclasspath "com.google.gms:google-services:3.0.0"' + os.EOL);
                    fs.appendFileSync('./build.gradle', '\t\tclasspath "com.android.tools.build:gradle:1.2.3+"' + os.EOL);
                }
            });

            fs.rename('./build.gradle', 'platforms/android/build.gradle', deferral.resolve);
        }
    });

    return deferral.promise;
};<commit_msg>Move the file once it's closed<commit_after>module.exports = function(ctx) {
    var fs = ctx.requireCordovaModule('fs'),
        path = ctx.requireCordovaModule('path'),
        os = require("os"),
        readline = require("readline"),
        deferral = ctx.requireCordovaModule('q').defer();

    var platformRoot = path.join(ctx.opts.projectRoot, 'www');
    var settingsFile = path.join(platformRoot, 'google-services.json');

    fs.stat(settingsFile, function(err,stats) {
        if (err) {
            deferral.reject("To use this plugin on android you'll need to add a google-services.json file with the FCM project_info and place that into your www folder");
        } else {

            fs.createReadStream(settingsFile).pipe(fs.createWriteStream('platforms/android/google-services.json'));

            var lineReader = readline.createInterface({
                input : fs.createReadStream('platforms/android/build.gradle')
            });
            lineReader.on("line", function(line) {
                fs.appendFileSync('./build.gradle', line.toString() + os.EOL);
                if (/.*\ dependencies \{.*/.test(line)) {
                    fs.appendFileSync('./build.gradle', '\t\tclasspath "com.google.gms:google-services:3.0.0"' + os.EOL);
                    fs.appendFileSync('./build.gradle', '\t\tclasspath "com.android.tools.build:gradle:1.2.3+"' + os.EOL);
                }
            }).on("close", function () {
                fs.rename('./build.gradle', 'platforms/android/build.gradle', deferral.resolve);
            });

        }
    });

    return deferral.promise;
};
{'fraction_non_alphanumeric': 0.15202275600505688, 'fraction_numerical': 0.0037926675094816687, 'mean_word_length': 2.4068891280947255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4530760', 'n_tokens_mistral': 945, 'n_tokens_neox': 890, 'n_words': 161}