Coder Social home page Coder Social logo

Comments (5)

waldyrious avatar waldyrious commented on June 30, 2024 2

We could simply check if the pages/common/tldr.md file exists, as a proxy for a dedicated init file :) would that work?

from tldr-node-client.

agnivade avatar agnivade commented on June 30, 2024

Note that npm's documentation recommends not to use sudo while doing install -g. But anyways, yes we can easily fix the documentation on the main site. It is mentioned in the node client repo though.

Having said that, I am not saying that we should go on with the post-install approach. Its quirky and unexpected. Coming to a proper fix, doing it in the first run would need state to be maintained in the client. We can write to a file saying that tldr has run for the first time, but that seems a bit crude. And then you have to check that file every time you run the command. I am open to other suggestions. :)

from tldr-node-client.

agnivade avatar agnivade commented on June 30, 2024

Hmm .. I am thinking something like this - if we do not run the --update command post install, cache will be empty. So, upon running any command, if that page is not found, it can simply run the --update and populate the cache. This has the advantage of not running any side logic of checking whether tldr is being run for the first time or not, and also automatically solves #9 too.

Only downside is it hurts the first use. But I guess its a decent tradeoff.

from tldr-node-client.

waldyrious avatar waldyrious commented on June 30, 2024

Well, the first use can be just delayed (wait for the update to conclude), not outright skipped, in case you were thinking of such a workflow. This is what Homebrew does, IIRC.

from tldr-node-client.

agnivade avatar agnivade commented on June 30, 2024

the first use can be just delayed (wait for the update to conclude), not outright skipped,

Of course I meant delayed :) But yea .. it still hurts.

from tldr-node-client.

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.