Code Monkey home page Code Monkey logo

Comments (12)

afragen avatar afragen commented on August 17, 2024

Is there anyway to grab this automatically from the GitHub API?

from git-updater.

GaryJones avatar GaryJones commented on August 17, 2024

I use git-flow on one of my projects, so develop is the default branch, and master is the clean branch that I'd want version checks and downloads to come from.

Compare:

You can see in the first one that the url in the output contains a ref=develop, so we can extrapolate that to determine the branch to download from when no "GitHub Branch: " is given.

You might also be able to spot that in this case, the content of the file is different - search on page for the string uMQ - it's in the first (develop is on version 1.1.1), but changes to uMA in the second (master is on version 1.1.0).

from git-updater.

afragen avatar afragen commented on August 17, 2024

Makes sense then to add a GitHub Branch: header and use it. After all, I did make it that way on purpose.

from git-updater.

afragen avatar afragen commented on August 17, 2024

We just need to ensure the renaming code still works. I've accidentally deleted lots of stuff testing it.

from git-updater.

GaryJones avatar GaryJones commented on August 17, 2024

There's nothing obviously hard-coded in the renaming method that references "master" - so we should be all right there.

from git-updater.

afragen avatar afragen commented on August 17, 2024

Does this commit 787b877 solve this issue?

from git-updater.

GaryJones avatar GaryJones commented on August 17, 2024

No, not quite, for two reasons (and this is why I said I'd already got code for it).

  1. You need a:
if ( ! empty( $this->github_plugin['branch'] ) )
    $endpoint = add_query_arg( 'ref', $this->github_plugin['branch'], $endpoint );

...just before the return line in get_api_url() so that the remote version check is made against the right branch.

  1. You're still falling back to the master branch for the download zip, instead of parsing out the url from the remote info to get the default branch name (the bit at the end of ?ref=develop).

from git-updater.

afragen avatar afragen commented on August 17, 2024

I've reverted the commit so you can make another PR. I left in the declaration for the GitHub Branch

from git-updater.

GaryJones avatar GaryJones commented on August 17, 2024

I'm working on this.

from git-updater.

afragen avatar afragen commented on August 17, 2024

You're working, I'm waiting πŸ˜‰

from git-updater.

GaryJones avatar GaryJones commented on August 17, 2024

Nearly there I think.

from git-updater.

GaryJones avatar GaryJones commented on August 17, 2024

Closing in favour of #13.

from git-updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.