-
-
Notifications
You must be signed in to change notification settings - Fork 14
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 author env variable if set #218
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how
$author
is initialized, unless it's an environment variable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read is a builtin command that sets environment variables.
sets
REPLY
sets
author
https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#index-read
https://www.computerhope.com/unix/bash/read.htm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other tracks using this same environment variable:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Believe me, I'm well aware how read works. I'm talking about line 25:
[[ -z $author ]]
-- when will the variable ever not be empty at line 25? I'm questioning the purpose of this PR.BTW read does not set environment variables, it sets a shell variable. It's up to
export
ordeclare -x
to make it available in the environment. This is a pet peeve of mine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I understand the question better now.
Before many tracks had
bin/create-exercise
scripts, I write my own for each track I was contributing to, that would copy in track-specific files and update .meta/config.json with my github handle.Now that many tracks have scripts, I should use those. My concern is that I might mistype my github handle. So I set
author
in my .profile.It isn't important, we don't need this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. In some of the other "create exercise" scripts I've written, I provided the ability to pass the author name by options:
./bin/create_exercise -a glennj forth
. Is that something you'd be interested in? You could writecreate_exercise -a $author $slug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That would be excellent.