plugins/update.js
function done(err, content) {
            if (err) return cb(err);

            var code = JSON.parse(self.square.package.source)
              , current = bundle.version || self.version(bundle.meta.content)
              , source;

            code.bundle[key].version = version;
            bundle.version = version;
            bundle.content = content;

            // now that we have updated the shizzle, we can write a new file
            // also update the old source with the new version
            source = JSON.stringify(code, null, 2);
            self.square.package.source = source;

            try {
              async.parallel([
                  async.apply(fs.writeFile, self.square.package.location, source)
                , async.apply(fs.writeFile, bundle.meta.location, content)
              ], function (err, results) {
                self.square.logger.notice(
                    'sucessfully updated %s from version %s to %s'
                  , key
                  , current.grey
                  , version.green
                );

                cb(err);
              });
            } catch (e) { err = e; }
          }
function done(err, content) {
            if (err) return cb(err);

            var code = JSON.parse(self.square.package.source)
              , current = bundle.version || self.version(bundle.meta.content)
              , source;

            code.bundle[key].version = version;
            bundle.version = version;
            bundle.content = content;

            // now that we have updated the shizzle, we can write a new file
            // also update the old source with the new version
            source = JSON.stringify(code, null, 2);
            self.square.package.source = source;

            try {
              async.parallel([
                  async.apply(fs.writeFile, self.square.package.location, source)
                , async.apply(fs.writeFile, bundle.meta.location, content)
              ], function (err, results) {
                self.square.logger.notice(
                    'sucessfully updated %s from version %s to %s'
                  , key
                  , current.grey
                  , version.green
                );

                cb(err);
              });
            } catch (e) { err = e; }
          }
function done ( err , content ) { if ( err ) return cb ( err ) ; var code = JSON . parse ( self . square . package . source ) , current = bundle . version || self . version ( bundle . meta . content ) , source ; code . bundle [ key ] . version = version ; bundle . version = version ; bundle . content = content ; // now that we have updated the shizzle, we can write a new file // also update the old source with the new version source = JSON . stringify ( code , null , 2 ) ; self . square . package . source = source ; try { async . parallel ( [ async . apply ( fs . writeFile , self . square . package . location , source ) , async . apply ( fs . writeFile , bundle . meta . location , content ) ] , function ( err , results ) { self . square . logger . notice ( 'sucessfully updated %s from version %s to %s' , key , current . grey , version . green ) ; cb ( err ) ; } ) ; } catch ( e ) { err = e ; } }
Handle file upgrades.

@param {Mixed} err
@param {String} content
@api private
Handle file upgrades .