Refactor run.sh script in a backward-compatible manner#9
Open
Phikimon wants to merge 2 commits intolisitsynSA:masterfrom
Open
Refactor run.sh script in a backward-compatible manner#9Phikimon wants to merge 2 commits intolisitsynSA:masterfrom
Phikimon wants to merge 2 commits intolisitsynSA:masterfrom
Conversation
First of all, I would leave all the building/cleaning to Make, because there is no need to reinvent building mechanics. But since run.sh is already used for building/cleaning/testing, I decided not to disrespect things as they are and just refactor the code, allowing usage in the original way. What are the enhancements? 1. Extra caution is used to make sure we do not do some unintended stuff: current directory is compared against script source directory; EUID is also checked to make sure we are not root. Usage of -f option makes following these conditional optional. 2. Verbose option is added, but for now it is pretty dumb and just prints full files' paths. I believe however this option will prove itself useful once some custom debug-printing lines are added. 3. Code redundancy is minimized: main part of run.sh is put in the shared directory. 4. Code is refactored, (hopefully) improving general readability. Since we do not use Make, let's at least have our own targets with blackjack and...
Author
|
Removed debug comment |
a0bedb3 to
eeaef3c
Compare
Author
|
Accidentally pushed hometask onto the same branch, just fixed that. |
Author
|
I just got to know that it is preferrable to point out exactly which (potential) bugs are being fixed:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First of all, I would leave all the building/cleaning to Make,
because there is no need to reinvent building mechanics.
But since run.sh is already used for building/cleaning/testing, I
decided not to disrespect things as they are and just refactor
the code, allowing usage in the original way.
What are the enhancements?
current directory is compared against script source directory; EUID
is also checked to make sure we are not root. Usage of -f option
makes following these conditional optional.
full files' paths. I believe however this option will prove itself
useful once some custom debug-printing lines are added.
shared directory.
we do not use Make, let's at least have our own targets with
blackjack and...