<commit_before>/*!
 * Brackets Git Extension
 *
 * @author <NAME>
 * @license http://opensource.org/licenses/MIT
 */

/*jslint plusplus: true, vars: true, nomen: true */
/*global define, brackets, console */

define(function (require, exports, module) {
    "use strict";

    // Get module dependencies.
    var q                          = require("./thirdparty/q"),
        AppInit                    = brackets.getModule("utils/AppInit"),
        CommandManager             = brackets.getModule("command/CommandManager"),
        Commands                   = brackets.getModule("command/Commands"),
        ExtensionUtils             = brackets.getModule("utils/ExtensionUtils"),
        FileEntry                  = brackets.getModule("file/NativeFileSystem").NativeFileSystem.FileEntry,
        FileUtils                  = brackets.getModule("file/FileUtils"),
        Menus                      = brackets.getModule("command/Menus"),
        NodeConnection             = brackets.getModule("utils/NodeConnection"),
        PreferencesManager         = brackets.getModule("preferences/PreferencesManager"),
        DefaultPreferences         = require("DefaultPreferences"),
        ExtensionMain              = require("src/Main"),
        Strings                    = require("strings"),
        ChangelogDialog            = require("src/ChangelogDialog"),
        SettingsDialog             = require("src/SettingsDialog"),
        SETTINGS_COMMAND_ID        = "brackets-git.settings",
        moduleDirectory            = ExtensionUtils.getModulePath(module),
        domainModulePath           = moduleDirectory + "domain",
        nodeConnection             = new NodeConnection();

    // Seems just too buggy right now
    q.stopUnhandledRejectionTracking();
    
    // Load CSS
    ExtensionUtils.loadStyleSheet(module, "less/brackets-git.less");

    // Initialize PreferenceStorage.
    var preferences = PreferencesManager.getPreferenceStorage(module, DefaultPreferences);
    preferences.setValue("extensionDirectory", moduleDirectory);

    // Handle settings dialog
    function openSettingsPanel() {
        SettingsDialog.show(preferences);
    }

    // Load package.json
    FileUtils.readAsText(new FileEntry(moduleDirectory + "package.json")).done(function (content) {
        var lastVersion    = preferences.getValue("lastVersion"),
            currentVersion = JSON.parse(content).version;

        if (lastVersion === null) {
            preferences.setValue("lastVersion", "firstStart");
            openSettingsPanel();
        } else if (lastVersion !== currentVersion) {
            preferences.setValue("lastVersion", currentVersion);
            ChangelogDialog.show(preferences);<commit_msg>Fixed require references in main.js<commit_after>/*!
 * Brackets Git Extension
 *
 * @author <NAME>
 * @license http://opensource.org/licenses/MIT
 */

/*jslint plusplus: true, vars: true, nomen: true */
/*global define, brackets, console */

define(function (require, exports, module) {
    "use strict";

    // Get module dependencies.
    var q                          = require("./thirdparty/q"),
        AppInit                    = brackets.getModule("utils/AppInit"),
        CommandManager             = brackets.getModule("command/CommandManager"),
        Commands                   = brackets.getModule("command/Commands"),
        ExtensionUtils             = brackets.getModule("utils/ExtensionUtils"),
        FileEntry                  = brackets.getModule("file/NativeFileSystem").NativeFileSystem.FileEntry,
        FileUtils                  = brackets.getModule("file/FileUtils"),
        Menus                      = brackets.getModule("command/Menus"),
        NodeConnection             = brackets.getModule("utils/NodeConnection"),
        PreferencesManager         = brackets.getModule("preferences/PreferencesManager"),
        DefaultPreferences         = require("./DefaultPreferences"),
        ExtensionMain              = require("./src/Main"),
        Strings                    = require("./strings"),
        ChangelogDialog            = require("./src/ChangelogDialog"),
        SettingsDialog             = require("./src/SettingsDialog"),
        SETTINGS_COMMAND_ID        = "brackets-git.settings",
        moduleDirectory            = ExtensionUtils.getModulePath(module),
        domainModulePath           = moduleDirectory + "domain",
        nodeConnection             = new NodeConnection();

    // Seems just too buggy right now
    q.stopUnhandledRejectionTracking();

    // Load CSS
    ExtensionUtils.loadStyleSheet(module, "less/brackets-git.less");

    // Initialize PreferenceStorage.
    var preferences = PreferencesManager.getPreferenceStorage(module, DefaultPreferences);
    preferences.setValue("extensionDirectory", moduleDirectory);

    // Handle settings dialog
    function openSettingsPanel() {
        SettingsDialog.show(preferences);
    }

    // Load package.json
    FileUtils.readAsText(new FileEntry(moduleDirectory + "package.json")).done(function (content) {
        var lastVersion    = preferences.getValue("lastVersion"),
            currentVersion = JSON.parse(content).version;

        if (lastVersion === null) {
            preferences.setValue("lastVersion", "firstStart");
            openSettingsPanel();
        } else if (lastVersion !== currentVersion) {
            preferences.setValue("lastVersion", currentVersion);
            ChangelogDialog.show(preferences);
{'fraction_non_alphanumeric': 0.10947176684881603, 'fraction_numerical': 0.0, 'mean_word_length': 2.3400243309002433, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '5666562', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1279, 'n_words': 239}