Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd to the project directory #7

Closed
francisceril opened this issue Sep 7, 2019 · 11 comments
Closed

cd to the project directory #7

francisceril opened this issue Sep 7, 2019 · 11 comments
Assignees
Labels
v1.2.0 Will be published in v1.2.0

Comments

@francisceril
Copy link

francisceril commented Sep 7, 2019

Not really an issue. Just a feature request if possible.

It would be nice if the terminal will also change directory after running the pm open project command.
Or even more, extend it to run npm scripts like npm start.

@saurabhdaware
Copy link
Owner

The first part is I guess similar to #5
The thing is it's just too hacky to implement it and don't really want to mess up the code. Also, I think almost all editors offer integrated terminal feature so I'll just leave this part to the editors.

Or even more, extend it to run npm scripts like npm start.

Can you explain more about this? I didn't exactly get it

@francisceril
Copy link
Author

francisceril commented Sep 7, 2019

The thing is it's just too hacky to implement it and don't really want to mess up the code. Also, I think almost all editors offer integrated terminal feature so I'll just leave this part to the editors.

I still use iTerm + Sublime  😃

Can you explain more about this? I didn't exactly get it

I use npm scripts to start my dev environment and I think most use it as well.

package.json

"scripts": {
"start": "cross-env NODE_ENV=development...
"build": "cross-env NODE_ENV=production...
},

Since the idea of this tool is to help quick start you from opening and running your project, I think it would really be nice if there's an option to run scripts rather than just opening the editor.
Although this setting should be per user and per project. Everyone has their own workflow.

@saurabhdaware
Copy link
Owner

You mean having a command like pm open <projectName> --run dev?

So everyone prefers different workflow and different setup and a lot of people I know including me will prefer the server or any npm script to be running inside the integrated terminal rather than having it on a separate terminal(so that I can just see the output in the editor itself without having to change tab)(and also I feel that this is how it should be) so I won't really recommend anyone to have their scripts running on different tab and editor on different.
and I don't really want to end up adding a command that will not be used by majority.

This feature would have been a fire if we could run the scripts inside the editor's terminal(which is not possible)

Is there anything else that you want to mention?

@ZakariaTalhami
Copy link
Contributor

I also use iTerm and other terminals, and dont use much of the integrated terminals, I would also like a way to cd into the project, especially if the path to the project is quite long.

If changing directory once the project is open isnt an option now, maybe a command can be made to return the path to the project so users would be able to use:
cd $(pm dir projectName)
or just be able to copy past the path.

I think this command would be useful for other cases as well. I would be willing to implement this if you agree.

@saurabhdaware
Copy link
Owner

The problem with directly cd /to/the/path is there is not straight forward way to implement it on node

maybe a command can be made to return the path to the project so users would be able to use:
cd $(pm dir projectName)

This sounds great alternative and yes you can go ahead with it! Can we discuss about the command name though? pm dir, pm getdir, pm showdir, pm showpath, pm getpath which one would make more sense?

@ZakariaTalhami
Copy link
Contributor

I would think either:

  1. getdir with alias of dir
  2. getpath with alias of path

which do you think is better?

@saurabhdaware
Copy link
Owner

I think getpath (since I am using path key in my settings too) with alias gp could save them from pressing few more keys.
What say?

@ZakariaTalhami
Copy link
Contributor

Sounds fine to me, ill open the PR when its ready.

@saurabhdaware
Copy link
Owner

Cool thanks! also just wondering can we do cd $(pm getPath) and keep projectName as optional argument so when projectName is not passed it will open the list as it does in pm open and pm remove command and then just select the project to cd inside it?

@ZakariaTalhami
Copy link
Contributor

I did some research and found this issue, and the solution seems to work, but the colors in my terminal in those cases dont work as expected.

@saurabhdaware saurabhdaware added bug Something isn't working v1.2.0 Will be published in v1.2.0 and removed bug Something isn't working labels Sep 7, 2019
@saurabhdaware
Copy link
Owner

saurabhdaware commented Sep 8, 2019

Resolved in #9 🎉
Thank you @francisceril and @ZakariaTalhami 🌻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.2.0 Will be published in v1.2.0
Projects
None yet
Development

No branches or pull requests

3 participants