src/extensions/default/AutoUpdate/main.js
function initializeState() {
        var result = $.Deferred();

        FileSystem.resolve(updateDir, function (err) {
            if (!err) {
                result.resolve();
            } else {
                var directory = FileSystem.getDirectoryForPath(updateDir);
                directory.create(function (error) {
                    if (error) {
                        console.error('AutoUpdate : Error in creating update directory in Appdata');
                        result.reject();
                    } else {
                        result.resolve();
                    }
                });
            }
        });

        return result.promise();
    }
function initializeState() {
        var result = $.Deferred();

        FileSystem.resolve(updateDir, function (err) {
            if (!err) {
                result.resolve();
            } else {
                var directory = FileSystem.getDirectoryForPath(updateDir);
                directory.create(function (error) {
                    if (error) {
                        console.error('AutoUpdate : Error in creating update directory in Appdata');
                        result.reject();
                    } else {
                        result.resolve();
                    }
                });
            }
        });

        return result.promise();
    }
function initializeState ( ) { var result = $ . Deferred ( ) ; FileSystem . resolve ( updateDir , function ( err ) { if ( ! err ) { result . resolve ( ) ; } else { var directory = FileSystem . getDirectoryForPath ( updateDir ) ; directory . create ( function ( error ) { if ( error ) { console . error ( 'AutoUpdate : Error in creating update directory in Appdata' ) ; result . reject ( ) ; } else { result . resolve ( ) ; } } ) ; } } ) ; return result . promise ( ) ; }
Initializes the state for AutoUpdate process
@returns {$.Deferred} - a jquery promise,
that is resolved with success or failure
of state initialization
Initializes the state for AutoUpdate process