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

fpp doesn't pass path to command properly for paths in the top dir w/out ./ prefix #47

Closed
Ramblurr opened this issue May 8, 2015 · 4 comments

Comments

@Ramblurr
Copy link

Ramblurr commented May 8, 2015

The output of ack -l or grep -l that lists as demonstrated below is parsed properly by fpp (the interactive selection works), but when you execute a command on it (for example open the editor) it doesn't pass the proper path.

In the case of the first file listed below, fpp passes the following to vim:

/home/user/www/system-images/android-22/default/x86_64

when the proper path is:

/home/user/**vendor/android/sdk/**system-images/android-22/default/x86_64/source.properties

  1. The CWD is /home/user/vendor/android/sdk/
  2. I have no idea where the www/ is coming from
ack xml -l | head                                                                                                                                                                    130 ↵
system-images/android-22/default/x86_64/source.properties
system-images/android-22/default/x86_64/NOTICE.txt
system-images/android-22/google_apis/x86_64/source.properties
system-images/android-22/google_apis/x86_64/NOTICE.txt
system-images/android-21/default/x86_64/source.properties
system-images/android-21/default/x86_64/NOTICE.txt
system-images/android-21/google_apis/x86/source.properties
system-images/android-21/google_apis/x86/NOTICE.txt
system-images/android-21/google_apis/x86_64/source.properties
system-images/android-21/google_apis/x86_64/NOTICE.txt
@Haraldson
Copy link

Experiencing the same. When the working directory is ~/www/project/, and I select a file and try running the command git add on it, PathPicker is attempting to add the file ~/www/src/app/app.js, while the proper path would be ~/www/project/www/src/app/app.js.

The command open, on the other hand, generates a full path like this: /Users/name/www/project/~/www/src/app/app.js, also not working. Without the tilde it’s golden.

@pcottle
Copy link
Contributor

pcottle commented May 11, 2015

I have no idea where the www/ is coming from

Yeah, we throw in the random www/ since thats the fallback for the facebook dev environment. its a giant hack though and super vestigial, so it should be removed regardless.

Question for you @Haraldson / @Ramblurr -- are you guys working in folders with version control? We should parse the top-level directory from version control and use that for the prepend:

https://github.com/facebook/PathPicker/blob/master/src/parse.py#L38-L66

in the meantime ill fallback to ./

@pcottle
Copy link
Contributor

pcottle commented May 11, 2015

I guess the weird thing is that we will output paths with ./ but they are still valid:

[pcottle:~/Dropbox (Facebook):]$ cat ./wip/./../wip/PathPicker/././src/choose.py  | wc -l
      85

@Haraldson / @Ramblurr its important to note though that the input you guys listed above is lacking some context on where the actual path is. with this change we'll assume ./system-images/android-21/google_apis/x86_64/NOTICE.txt is a valid file, but for commands like git grep thats not always valid

@pcottle
Copy link
Contributor

pcottle commented May 15, 2015

In the 0.5.7 release, adding PR to homebrew now:
https://github.com/facebook/PathPicker/releases/tag/0.5.7

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

No branches or pull requests

3 participants