Added -i flag to all rm statements, Updated README #10
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.
PR created after issue #9
After getting my PC's home directory wiped out, I decided to modify some of the code for it to be safer.
What caused the issue was this part of the code:
Firstly, you should never assume that the user wants the
TLauncherDir
elsewhere than in the repository. Creating a flag for the script to adapt to this would be a great addition.Next, note this: if there is no
.jar
file in the repository's directory, theTLauncherName
variable will be set to*
(try runningecho $(basename *.jar .jar)
in the cloned repository). The problem comes here:TLauncherDir
is then set to$HOME/*
The
rm -rf $TLauncherDir
statement then deletes recursively$HOME/*
, that is every folder existing in the user's home directory.The addition of a⚠️ Careful! During the execution of
-i
flag to eachrm
statements is what allows the user to see each file that is about to get deleted, and refuse its deletion if an error occurs. I made sure the README explains it too:"
setup.py
, you will be prompted byrm -rf
statements. Respondy
if you want the file deleted, orn
if not."