Giter Club home page Giter Club logo

Comments (5)

jamesob avatar jamesob commented on July 29, 2024

Yeah, I'm definitely interested in supporting something complementary at desk's layer. Thanks for the detailed write-up of your thoughts.

I've been drafting a behavior to facilitate easy sharing of project-specfic deskfiles that may dovetail with your flow. Imagine a convention where we had Deskfile (or deskfile.sh, either way) live at the root of a project's source tree. You check out the project, cd into it, then run desk import .. This would symlink the project Deskfile into your $DESK_DESKS_DIR.

Question there is: some (maybe most) deskfiles start off with a cd ~/project/dir... how do we handle that in an imported deskfile, where the path of the project's checkout is unknown?

One option would be to support some comment syntax for saying "this is a project deskfile; if it's symlinked, read the link and cd to the basedir of the source." Something like

# /tmp/checkout/spectac_proj/Deskfile
#
# Description: my spectacular project
# Name: specproj
# Root: .

alias whatever='baz'
...

So then when you desk . specproj, it reads the symlink and cds you into /tmp/checkout/spectac_proj. I'm not wild about having to specify the name, so maybe we could think of a clever way to infer that.

What do you make of the above? Would it be useful for your wrapper?


I think your instinct is right with regard to the caveats you list: at some point I'd like to be able to optionally recognize git (and other vcs) if it's easy, but I definitely don't want to take on any dependencies in doing so. It requires some more thought, but I think there's potential there.

from desk.

rnewton avatar rnewton commented on July 29, 2024

I like this approach better for the general use-case. It doesn't really match what I'd be able to do immediately as I'm the only one evaluating desk at my company at the moment and it might be a hard sell to place another file at source root (to live with grunt, npm, composer, bower, etc). However, I could easily get my wrapper script to 'inject' the deskfile into the project after checkout and then follow the same flow you describe after that point.

I can't think of a way to infer things like the project directory or the name of the project that aren't fraught with special cases or magic. In any case, I'm not opposed to optionally specifying the name and root directory, but we'd just have to be careful to not require too much configuration right off the bat.

from desk.

TristanBurnside avatar TristanBurnside commented on July 29, 2024

I also think some sort of project specific setup would be really useful.

Why not just get desk to search for the deskfile in the current directory first, then if it doesn't exist look in $DESK_DESKS_DIR?

That would resolve the cd ~/project/dir... issue because you will already be there, just open the new shell at the current directory of the old one.

from desk.

flosell avatar flosell commented on July 29, 2024

@TristanBurnside: +1

from desk.

jamesob avatar jamesob commented on July 29, 2024

Sounds good -- I'll throw together an implementation for that pretty soon.

from desk.

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.