dotfiles/bin/update-msys-shell

23 lines
726 B
Bash

#!/usr/bin/env bash
source "$HOME/.dotfiles/script_helpers/printing.sh"
source "$HOME/.dotfiles/script_helpers/platform.sh"
set -e
if [[ -d "/c/msys64" ]]; then
shell_is_mingw is_mingw
if [[ $is_mingw -eq 1 ]]; then
printf "${BOLD}${YELLOW}Updating MSYS Shell${NORMAL}\n"
pacman -Syu
printf "${BOLD}${GREEN}Done!${NORMAL}\n"
printf "\n${BOLD}If you've been asked to close the shell then once you reopen it, run ${YELLOW}pacman -Su${NORMAL} to finish updating.\n"
else
error "Please re-run this in a MinGW shell.\n"
exit 1
fi
else
error "Unable to find C:\msys64 - make sure the shell is installed and then re-run this in the MinGW shell.\n"
exit 1
fi