lib/sproutcore/bundle_installer.rb
# Attempts to update the named bundle to the latest revision using any
# passed options.  If the directory does not contain a git repository,
# and the :force option is set, then this tool will delete the file at the 
# specified location and re-install it.
Attempts to update the named bundle to the latest revision using any
passed options.  If the directory does not contain a git repository,
and the :force option is set, then this tool will delete the file at the
specified location and re-install it.
Attempts to update the named bundle to the latest revision using any passed options . If the directory does not contain a git repository and the : force option is set then this tool will delete the file at the specified location and re - install it .
def update(bundle_name, opts = {})
      install_path = normalize_install_path(bundle_name, opts) 
      display_path = display_path_for(install_path)
      git_path = File.join(install_path, '.git')
      if (!File.exists?(install_path))
        SC.logger.info(" ~ #{bundle_name} is not installed.")
        self.install(bundle_name, opts)
      elsif File.exists?(git_path)
        SC.logger.info("Updating #{bundle_name} at #{display_path}...")
        if !has_git?
          SC.logger.warn(" ~ git it not installed!")
          raise "Cannot update because git is installed"
        else
          SC.logger.debug(" ~ cd #{install_path};")
          SC.logger.debug(" ~ git pull")
          if !opts[:dry_run]
            `cd #{install_path}; git pull`
          end
        end
      elsif opts[:force]
        SC.logger.info("Updating #{bundle_name} at #{display_path}...")
        SC.logger.warn(" ~ Installed bundle was not installed using git.  Removing and reinstalling instead.")
        remove(bundle_name, opts)
        install(bundle_name, opts)
      else
        SC.logger.info("Updating #{bundle_name} at #{display_path}...")
        SC.logger.fatal(" ~ Something is already installed at #{display_path} that cannot be updated!")
        SC.logger.fatal(" ~ Try the --force option to remove and reinstall instead.")
      end
    end
def update ( bundle_name , opts = { } ) install_path = normalize_install_path ( bundle_name , opts ) display_path = display_path_for ( install_path ) git_path = File . join ( install_path , '.git' ) if ( ! File . exists? ( install_path ) ) SC . logger . info ( " ~ #{bundle_name} is not installed." ) self . install ( bundle_name , opts ) elsif File . exists? ( git_path ) SC . logger . info ( "Updating #{bundle_name} at #{display_path}..." ) if ! has_git? SC . logger . warn ( " ~ git it not installed!" ) raise "Cannot update because git is installed" else SC . logger . debug ( " ~ cd #{install_path};" ) SC . logger . debug ( " ~ git pull" ) if ! opts [ :dry_run ] ` cd  #{ install_path } ; git pull ` end end elsif opts [ :force ] SC . logger . info ( "Updating #{bundle_name} at #{display_path}..." ) SC . logger . warn ( " ~ Installed bundle was not installed using git.  Removing and reinstalling instead." ) remove ( bundle_name , opts ) install ( bundle_name , opts ) else SC . logger . info ( "Updating #{bundle_name} at #{display_path}..." ) SC . logger . fatal ( " ~ Something is already installed at #{display_path} that cannot be updated!" ) SC . logger . fatal ( " ~ Try the --force option to remove and reinstall instead." ) end end
Attempts to update the named bundle to the latest revision using any
passed options.
Attempts to update the named bundle to the latest revision using any passed options .
bundle_name
<not_specific>
opts
<not_specific>