Giter Club home page Giter Club logo

Comments (9)

pesterhazy avatar pesterhazy commented on May 26, 2024 2

Gave it a try here https://github.com/pesterhazy/presumably/blob/master/posts/howto-babashka.md#find-project-folder

from fs.

borkdude avatar borkdude commented on May 26, 2024 1

I mentioned dirname in the docs of parent now.

from fs.

borkdude avatar borkdude commented on May 26, 2024

OK, PR welcome for dir-name (as we have file-name, I think the hyphen would be ok?)

Note that seq works on the result of fs/path to split the components, but we could add this as a built-in.

I believe we already have split-list as split-paths in fs.

from fs.

dbohdan avatar dbohdan commented on May 26, 2024

Note that seq works on the result of fs/path to split the components, but we could add this as a built-in.

Oh, I didn't realize this. Thanks for explaining! And there turns out to be fs/components, which works like split-path except for the return type. Sorry I didn't look thoroughly enough before filing an issue. I missed it in API.md, probably because other file path APIs had primed me to look for different function names. (Maybe it needs a Ctrl+f-friendly note like "Use this to split a path.")

While I can't right now, I will PR dir-name when I can. (I agree it needs a hyphen.)

from fs.

borkdude avatar borkdude commented on May 26, 2024

On second thought: dir-name is already kind of there as: (-> file fs/parent str). parent is the Java terminology of getting the parent directory from a file and str is the way of turning a file or path into a string. Not sure if we need to add (defn dir-name [file] (-> file fs/parent str))?

We could also add a cheat sheet of bash terminology -> fs terminlogy.

cc @pesterhazy

from fs.

borkdude avatar borkdude commented on May 26, 2024

except for the return type

You can fix this by doing (map str ...).

from fs.

dbohdan avatar dbohdan commented on May 26, 2024

Oops, I missed not one but two of the two functions I wanted. :-) With fs/parent there is no need for fs/dir-name. If nobody disagrees, I suggest closing the issue.

We could also add a cheat sheet of bash terminology -> fs terminlogy.

This is a great idea. Thanks for starting one, @pesterhazy.

from fs.

felixdo avatar felixdo commented on May 26, 2024

parent is alright, but one has to be careful: (parent "hello.clj") returns nil, while dirname "hello.clj" is '.'

from fs.

borkdude avatar borkdude commented on May 26, 2024

We could change that perhaps

from fs.

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.