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

Examples don't respect links #24

Closed
srsudar opened this issue May 9, 2015 · 4 comments
Closed

Examples don't respect links #24

srsudar opened this issue May 9, 2015 · 4 comments

Comments

@srsudar
Copy link
Owner

srsudar commented May 9, 2015

@mcarton has begun adding examples with symbolic links for aliases like netcat and nc, which are the same command. #21 and #22 are two examples. This is a good idea, and something I'd thought about doing for link and ln as well, but didn't.

The system currently isn't following these links, so this approach is failing.

Can we put symbolic links in a repo and have windows as well as *nix systems respect them? I need to look into this. If it's possible, I'll have to update the code to obey it. If not, we'll have to think of something else.

@mcarton
Copy link
Contributor

mcarton commented May 9, 2015

I admit I never considered Windows while I created those symlinks. There does not seem to be a clean way to have git handle Unix symlinks on Windows. Maybe the installer could do handle that? I don't have Windows so I cannot test.
Or we could add a dictionary somewhere that would be looked at when a file is not found:

synonyms = {
  'clang': 'gcc',
  'link': 'ln',
  'netcat': 'nc',
}

@srsudar
Copy link
Owner Author

srsudar commented May 9, 2015

The synonyms idea is a good one. There's something very elegant about the symlinks, though.

I also like having to modify as few files as possible to add an alias. Although I suppose there could a file in examples/ that is just synonyms.

I'm going to mull this over a bit and try and get ahold of a windows box to mess around with. You'd think the *nix commands would be run mostly on *nix machines, but people have been using them on windows a fair bit.

@srsudar
Copy link
Owner Author

srsudar commented May 13, 2015

It looks like Windows doesn't handle symlinks gracefully. I'll plan on adding the alias dictionary.

@srsudar
Copy link
Owner Author

srsudar commented May 17, 2015

In the tip there is now an examples/aliases.json file that handles aliases. So if someone wants to create an alias for link to ln, they would create a key-value pair in JSON syntax in that file.

I chose JSON because it works natively as far back as 2.6, and most importantly it is user-editable, unlike the pickle module.

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

2 participants