src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
function checkInstallerStatus(requester, searchParams) {
        var installErrorStr = searchParams.installErrorStr,
            bracketsErrorStr = searchParams.bracketsErrorStr,
            updateDirectory = searchParams.updateDir,
            encoding =        searchParams.encoding || "utf8",
            statusObj = {installError: ": BA_UN"},
            logFileAvailable = false,
            currentRequester = requester || "";

        var notifyBrackets = function notifyBrackets(errorline) {
            statusObj.installError = errorline || ": BA_UN";
            postMessageToBrackets(MessageIds.NOTIFY_INSTALLATION_STATUS, currentRequester, statusObj);
        };

        var parseLog = function (files) {
            files.forEach(function (file) {
                var fileExt = path.extname(path.basename(file));
                if (fileExt === ".logs") {
                    var fileName = path.basename(file),
                        fileFullPath = updateDirectory + '/' + file;
                    if (fileName.search("installStatus.logs") !== -1) {
                        logFileAvailable = true;
                        parseInstallerLog(fileFullPath, bracketsErrorStr, "utf8", notifyBrackets);
                    } else if (fileName.search("update.logs") !== -1) {
                        logFileAvailable = true;
                        parseInstallerLog(fileFullPath, installErrorStr, encoding, notifyBrackets);
                    }
                }
            });
            if (!logFileAvailable) {
                postMessageToBrackets(MessageIds.NOTIFY_INSTALLATION_STATUS, currentRequester, statusObj);
            }
        };

        fs.readdir(updateDirectory)
            .then(function (files) {
                return parseLog(files);
            }).catch(function () {
                postMessageToBrackets(MessageIds.NOTIFY_INSTALLATION_STATUS, currentRequester, statusObj);
            });
    }
function checkInstallerStatus(requester, searchParams) {
        var installErrorStr = searchParams.installErrorStr,
            bracketsErrorStr = searchParams.bracketsErrorStr,
            updateDirectory = searchParams.updateDir,
            encoding =        searchParams.encoding || "utf8",
            statusObj = {installError: ": BA_UN"},
            logFileAvailable = false,
            currentRequester = requester || "";

        var notifyBrackets = function notifyBrackets(errorline) {
            statusObj.installError = errorline || ": BA_UN";
            postMessageToBrackets(MessageIds.NOTIFY_INSTALLATION_STATUS, currentRequester, statusObj);
        };

        var parseLog = function (files) {
            files.forEach(function (file) {
                var fileExt = path.extname(path.basename(file));
                if (fileExt === ".logs") {
                    var fileName = path.basename(file),
                        fileFullPath = updateDirectory + '/' + file;
                    if (fileName.search("installStatus.logs") !== -1) {
                        logFileAvailable = true;
                        parseInstallerLog(fileFullPath, bracketsErrorStr, "utf8", notifyBrackets);
                    } else if (fileName.search("update.logs") !== -1) {
                        logFileAvailable = true;
                        parseInstallerLog(fileFullPath, installErrorStr, encoding, notifyBrackets);
                    }
                }
            });
            if (!logFileAvailable) {
                postMessageToBrackets(MessageIds.NOTIFY_INSTALLATION_STATUS, currentRequester, statusObj);
            }
        };

        fs.readdir(updateDirectory)
            .then(function (files) {
                return parseLog(files);
            }).catch(function () {
                postMessageToBrackets(MessageIds.NOTIFY_INSTALLATION_STATUS, currentRequester, statusObj);
            });
    }
function checkInstallerStatus ( requester , searchParams ) { var installErrorStr = searchParams . installErrorStr , bracketsErrorStr = searchParams . bracketsErrorStr , updateDirectory = searchParams . updateDir , encoding = searchParams . encoding || "utf8" , statusObj = { installError : ": BA_UN" } , logFileAvailable = false , currentRequester = requester || "" ; var notifyBrackets = function notifyBrackets ( errorline ) { statusObj . installError = errorline || ": BA_UN" ; postMessageToBrackets ( MessageIds . NOTIFY_INSTALLATION_STATUS , currentRequester , statusObj ) ; } ; var parseLog = function ( files ) { files . forEach ( function ( file ) { var fileExt = path . extname ( path . basename ( file ) ) ; if ( fileExt === ".logs" ) { var fileName = path . basename ( file ) , fileFullPath = updateDirectory + '/' + file ; if ( fileName . search ( "installStatus.logs" ) !== - 1 ) { logFileAvailable = true ; parseInstallerLog ( fileFullPath , bracketsErrorStr , "utf8" , notifyBrackets ) ; } else if ( fileName . search ( "update.logs" ) !== - 1 ) { logFileAvailable = true ; parseInstallerLog ( fileFullPath , installErrorStr , encoding , notifyBrackets ) ; } } } ) ; if ( ! logFileAvailable ) { postMessageToBrackets ( MessageIds . NOTIFY_INSTALLATION_STATUS , currentRequester , statusObj ) ; } } ; fs . readdir ( updateDirectory ) . then ( function ( files ) { return parseLog ( files ) ; } ) . catch ( function ( ) { postMessageToBrackets ( MessageIds . NOTIFY_INSTALLATION_STATUS , currentRequester , statusObj ) ; } ) ; }
one it finds the line which has any of error String
after parsing the Log
it notifies the bracket.
@param{Object} searchParams is object contains Information Error String
Encoding of Log File Update Diectory Path.
one it finds the line which has any of error String after parsing the Log it notifies the bracket .