Giter Site home page Giter Site logo

Comments (10)

jomo avatar jomo commented on May 20, 2024

Well the "spacing error" is caused by the bug itself.

from imgur-screenshot.

jomo avatar jomo commented on May 20, 2024

I changed the way i figure the source directory, tested on Ubuntu and OS X.
It should be working now 👍

from imgur-screenshot.

jomo avatar jomo commented on May 20, 2024

@Brottweiler can you confirm it's working now?

from imgur-screenshot.

Brottweiler avatar Brottweiler commented on May 20, 2024

It's working! But first I just downloaded the script itself, and it did not seem to work. Then I cloned the repo so I got the .versions.txt file in the same directory, then it worked. Have you tried just downloading and running the script itself? Does it manage to check the remote .version.txt?

from imgur-screenshot.

jomo avatar jomo commented on May 20, 2024

Hmm perhaps it would be a good idea to check if the file was found. if not, give a warning and fallback to empty string.

from imgur-screenshot.

Brottweiler avatar Brottweiler commented on May 20, 2024

In the code you can see that it runs curl -f on the remote .version.txt file, but if the file does not exist locally it will still result in that error that .version.txt cannot be found, becuase it compares the remote .version.txt with the local version of the file.
So if you only download the script, you won't have the .version.txt file.

One idea would be to have the version number in the script itself, as a variable, instead of a separate file. Then when you run it, and have the update checker enabled, it would compare that variable with the remote .version.txt file and see if they are the same.

If they are not the same, or remote version (.version.txt) is newer than local version (variable), it would tell you there's an update.
Because the variable version in the script will always be the same until you update the script by re-downloading it, and when you done that you have the new version in the script.

I am unable to test where I am currently, but would you not just be able to remove #L123 and #L124, then (for simplicitys sake) add

current_version="1.2.2"

to line #L22 or something?

from imgur-screenshot.

jomo avatar jomo commented on May 20, 2024

Yea, I'll put that in a variable in the next release ;)

from imgur-screenshot.

jomo avatar jomo commented on May 20, 2024

I'd need to download the whole file each time and do some extra parsing, don't like that too much.
Will probably put it at the top of the script.

from imgur-screenshot.

jomo avatar jomo commented on May 20, 2024

Better idea: I store the version in a variable in the file. The version is written to file if not found or the file doesn't match with the variable. That way I can use the file on github to compare.

from imgur-screenshot.

Brottweiler avatar Brottweiler commented on May 20, 2024

Was that not what I suggested? O.o

from imgur-screenshot.

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.