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

Feature request: Customize the opening of start and stop scripts #27

Closed
NVolcz opened this issue Oct 13, 2015 · 7 comments
Closed

Feature request: Customize the opening of start and stop scripts #27

NVolcz opened this issue Oct 13, 2015 · 7 comments

Comments

@NVolcz
Copy link

NVolcz commented Oct 13, 2015

When using prm with cygwin on Windows, native editors can't handle the unix path.
Example:

$ bash -x ~/bin/prm/prm.sh add test1
+ sublime_text.exe /home/myusername/.prm/test1/start.sh
+ sublime_text.exe /home/myusername.prm/test1/stop.sh

Some way to customize the path is therefor wanted, and should provide the possibility to execute the following line:

sublimetext `cygpath.exe -d "/home/myusername/.prm/test1/start.sh"`

The line in question:
https://github.com/eivind88/prm/blob/master/prm.sh#L164

@EivindArvesen
Copy link
Owner

Unfortunately, I currently have no way to test prm on WIndows (with Cygwin), but I think this can be fixed pretty quickly.

What does the command
uname -s
output under Cygwin?

Something matching CYGWIN_*?

EivindArvesen added a commit that referenced this issue Oct 13, 2015
Fix copy option bug that opens wrong/nonexistant files in editor
Add Cygwin compatibility (issue #27)
Add mock-tests for Cygwin compatibility (add, copy, edit)
@EivindArvesen
Copy link
Owner

I think I've fixed your issue.
See the commit referencing this issue, and the feature branch.
Let me know how it works!

@EivindArvesen
Copy link
Owner

@NVolcz : I've pushed a fix based on your comment.

@NVolcz
Copy link
Author

NVolcz commented Oct 15, 2015

I'm getting other errors now. I was using efb759b before and now I'm getting the following error:

$ prm add
prm MUST be sourced - not run in a subshell.
i.e. '. ./prm'

Debug output:

$ bash -x ./prm.sh add
+ COPY='Written by Eivind Arvesen, 2015.'
+ VERSION=0.5.0
++ printf 'prm MUST be sourced - not run in a subshell.\ni.e. '\''. ./prm'\''\n'
++ echo ' '
+ SOURCE='prm MUST be sourced - not run in a subshell.
i.e. '\''. ./prm'\''
 '
++ basename ./prm.sh
+ '[' prm.sh = prm.sh ']'
++ printf %s 'prm MUST be sourced - not run in a subshell.
i.e. '\''. ./prm'\''
 '
+ return_error 1 'prm MUST be sourced - not run in a subshell.
i.e. '\''. ./prm'\''
 '
+ '[' 'prm MUST be sourced - not run in a subshell.
i.e. '\''. ./prm'\''
 ' ']'
+ echo 'prm MUST be sourced - not run in a subshell.
i.e. '\''. ./prm'\''
 '
prm MUST be sourced - not run in a subshell.
i.e. '. ./prm'

+ '[' 1 ']'
+ return 1
+ exit

@EivindArvesen
Copy link
Owner

@NVolcz : Are you using the feature branch?

And is "prm" in your case a reference to an alias, where the script is sourced (as alluded to in the error message)?

The debug output you cited will always be the same, as long as prm is run with bash (in a subshell), as opposed to with . or source (sourced). For more information, see the readme.

P.S. If you don't already know, the prm "add" option takes at least one argument (project name).

@NVolcz
Copy link
Author

NVolcz commented Oct 15, 2015

It works now! My alias was not correctly configured, pardon for not RTFM :-).
The fix also works fine with both vim and sublime text as editors.

@EivindArvesen
Copy link
Owner

Great to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants