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

Update the installer! #43

Merged

Conversation

pschmitt
Copy link
Member

@pschmitt pschmitt commented Nov 11, 2021

  • Update default install dir to XDG_DATA_HOME/zinit/zinit.git (Update the default install dir #40)
  • Shellchecked the install script
  • Updated references to zdharma, the wiki etc.
  • Bonus: One can now set the branch to use for installs via ZINIT_BRANCH (defaults to master) This might be useful for development, CI and when (if!) we decide to update change the main branch of zinit to "main".

@pschmitt pschmitt changed the title Update default install dir to XDG_DATA_HOME/zinit/zinit.git Update the installer! Nov 11, 2021
@pschmitt pschmitt added this to the zinit 4.0 milestone Nov 11, 2021
@pschmitt pschmitt added the packaging Issue related to packaging & distribution label Nov 11, 2021
doc/install.sh Show resolved Hide resolved
doc/install.sh Outdated
# Get the download-progress bar tool
GIT_PROCESS_SCRIPT_URL="https://raw.githubusercontent.com/zdharma-continuum/zinit/${ZINIT_BRANCH}/git-process-output.zsh"
mkdir -p /tmp/zinit
cd /tmp/zinit || { echo "Failed to cd to /tmp/zinit" >&2; exit 1; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're messing with temp directories, how about fixing the security issues?

Use TMPDIR if available with a fallback to /tmp/zinit-$UID/ and ensure you properly chmod/chown or exit if it already exists.

Copy link
Member Author

@pschmitt pschmitt Nov 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to do so but a bit out of scope for this MR. Will do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: f4e1468

echo "▓▒░ .zshrc already contains \`zinit …' commands – not making changes."
RCUPDATE=0
fi

if [ $RCUPDATE -eq 1 ]; then
echo "▓▒░ Updating $THE_ZDOTDIR/.zshrc (10 lines of code, at the bottom)"
ZINIT_HOME="$(echo $ZINIT_HOME | sed "s|$HOME|\$HOME|")"
ZINIT_HOME="$(echo "$ZINIT_HOME" | sed "s|$HOME|\$HOME|")"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done entirely in Zsh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the entire script could in zsh. What's your point?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed that it was in /bin/sh. My bad.

Copy link
Member

@alichtman alichtman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Would love to see bash coloring functions instead of inlined escape characters, but it's just a wishlist item.

@pschmitt
Copy link
Member Author

Lgtm. Would love to see bash coloring functions instead of inlined escape characters, but it's just a wishlist item.

That actually bothered me as well. Didn't want to create a "I REWROTE THE ENTIRE INSTALLER PLZ REVIEW" MR though :D

I'll create an issue to refactor and over-engineer the install script.

@pschmitt pschmitt mentioned this pull request Nov 14, 2021
4 tasks
@pschmitt pschmitt merged commit 7b0cbe0 into zdharma-continuum:master Nov 14, 2021
@pschmitt pschmitt deleted the update-default-install-dir branch November 14, 2021 09:33
@pschmitt pschmitt restored the update-default-install-dir branch November 30, 2021 10:57
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

🎉 This PR is included in version 3.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pschmitt pschmitt deleted the update-default-install-dir branch November 14, 2022 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Issue related to packaging & distribution released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants