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

Use $XONSHRC environment variable to ascertain files #274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rickysarraf
Copy link

Because the assumption that those hard-coded paths are the only paths a user may have feels wrong.

Also, Because pathlib.Path wasn't resolving ~ to a proper absolute path.

♄ 19:46:51 rrs@priyasi ~  [1]                                                                                                                                      ☸ cs00114-we-01-aks
@ from pathlib import Path
♒︎ 19:46:56 rrs@priyasi ~                                                                                                                                          ☸ cs00114-we-01-ak s
@ Path("~/.xonshrc")
PosixPath('~/.xonshrc')
⛢ 19:47:16 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ Path("~/.xonshrc").is_file()
False
♅ 19:47:22 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ Path("/home/rrs/.xonshrc").is_file()
True
ॐ 19:47:30 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ $XONSHRC
('/etc/xonsh/xonshrc', '/home/rrs/.config/xonsh/rc.xsh', '/home/rrs/.xonshrc')
⛢ 19:48:21 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ for file in $XONSHRC:
.     print(file)
.
/etc/xonsh/xonshrc
/home/rrs/.config/xonsh/rc.xsh
/home/rrs/.xonshrc

Because the assumption that those hard-coded paths are the only
paths a user may have feels wrong.

Also, Because pathlib.Path wasn't resolving ~ to a proper absolute
path.

```
♄ 19:46:51 rrs@priyasi ~  [1]                                                                                                                                      ☸ cs00114-we-01-aks
@ from pathlib import Path
♒︎ 19:46:56 rrs@priyasi ~                                                                                                                                          ☸ cs00114-we-01-ak s
@ Path("~/.xonshrc")
PosixPath('~/.xonshrc')
⛢ 19:47:16 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ Path("~/.xonshrc").is_file()
False
♅ 19:47:22 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ Path("/home/rrs/.xonshrc").is_file()
True
ॐ 19:47:30 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ $XONSHRC
('/etc/xonsh/xonshrc', '/home/rrs/.config/xonsh/rc.xsh', '/home/rrs/.xonshrc')
⛢ 19:48:21 rrs@priyasi ~                                                                                                                                           ☸ cs00114-we-01-aks
@ for file in $XONSHRC:
.     print(file)
.
/etc/xonsh/xonshrc
/home/rrs/.config/xonsh/rc.xsh
/home/rrs/.xonshrc
````
Closes: sbstp#243
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

Successfully merging this pull request may close these issues.

1 participant