-
Notifications
You must be signed in to change notification settings - Fork 77
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
Update install.sh
#215
Update install.sh
#215
Conversation
Hmm - is it necessary to make such drastic changes? Various people spent some time making it as good as possible last time, and also, since I barely know Linux, I'm nervous about changing it, especially when strings like "sudo rm -rf" pop up... |
Well, kind of. I made the changes I made because I want the script to be as maintainable as possible going forward, not necessarily taking into account the amount I'm changing.
I really can't agree that it's "as good as possible", no disrespect to the people who worked on this. There were several things that could be improved that I saw:
Again, it's my principle to make code that pass through my hands as high quality as I can. And in this case, it does indeed involve lots of changes.
That's okay. Any That being said, I would argue that the |
for FILE in "${INSTALL_DIR}" "${BIN_SYMLINK_PATH}" "${DESKTOP_ENTRY_PATH}" "${ICON_PATH}"; do | ||
sudo rm -rf "$FILE" | ||
sudo mkdir -p $(dirname "$FILE") | ||
done |
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.
${INSTALL_DIR}
${BIN_SYMLINK_PATH}
${DESKTOP_ENTRY_PATH}
and ${ICON_PATH}
are all statically defined. It's just deleting several files at statically-known locations, so there's really nothing unsafe here.
LOCATION="/opt/${FILE_NAME}" | ||
echo "Unzipping to $LOCATION, sudo needed" | ||
echo sudo unzip -qq ${ZIP_NAME} -d /opt/ | ||
sudo unzip -qq ${ZIP_NAME} -d /opt/ |
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.
This sudo unzip -d /opt/
on the other hand, I really do not like at all.
# extract | ||
echo "Extracting..." | ||
unzip -q "${ZIP_NAME}" | ||
echo "Successfully extracted Nibbler" | ||
UNZIPPED_NAME="${ZIP_NAME%.zip}" |
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.
This unzips into a tempdir
# install new | ||
sudo mv "${UNZIPPED_NAME}" "${INSTALL_DIR}" | ||
sudo ln -s "${INSTALL_DIR}/nibbler" "${BIN_SYMLINK_PATH}" | ||
sudo mv "linux/nibbler.desktop" "${DESKTOP_ENTRY_PATH}" | ||
sudo mv "nibbler.png" "${ICON_PATH}" |
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.
... and only install statically-known files into system directories.
I had some people look at it and they seem happy enough, so go ahead. Uh, are you wanting 2.3.9 to exist before you complete this? |
@cyqsimon - also if you're ready I guess I'll merge the reorganise branch into master? |
Sure. I'll notify downstream on AUR to update their build script when you're done. |
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 guess.
@cyqsimon - so everything is done and 2.3.9 now exists. Uh, I guess the one-liner to install Nibbler is:
Right? |
@rooklift I like this more: curl -L https://raw.githubusercontent.com/rooklift/nibbler/master/files/scripts/install.sh | bash It's cleaner, and is consistent with the script in that it doesn't require |
OK. |
I think this is good enough, although I cannot fully test it until there's a new release using the updated
builder.py
.Don't rush with the release though, I want to merge #214 first (which also requires me to change 2 or 3 lines in
install.sh
).