encapsluate install yay function

This commit is contained in:
DefectingCat
2024-01-03 10:12:17 +08:00
parent 8c3b3fad1a
commit 3f63c3509f
4 changed files with 19 additions and 8 deletions

View File

@ -12,7 +12,7 @@ RUN useradd --groups wheel --no-create-home --shell /bin/zsh ${USER} \
&& usermod -s "$(which zsh)" ${USER}
WORKDIR /home/${USER}
RUN rm -rf /home/${USER}/dotfiles \
&& rm -rf /home/${USER}/yay
&& rm -rf /home/${USER}/yay
RUN chown -R "${USER}":"${USER}" /home/"${USER}"
USER ${USER}

View File

@ -0,0 +1,4 @@
FROM archlinux
ARG USER=xfy
WORKDIR /app

View File

@ -1,13 +1,9 @@
#!/bin/bash
source ./install-yay.sh
# install yay
cd /home/"$USER"/ || exit
git clone https://aur.archlinux.org/yay.git
cd /home/"$USER"/yay || exit
makepkg -si --noconfirm
cd /home/"$USER"/ || exit
rm -rf yay
echo "install yay success"
install_yay
cd /home/"$USER"/ || exit

11
scripts/install-yay.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
install_yay() {
cd /home/"$USER"/ || exit
git clone https://aur.archlinux.org/yay.git
cd /home/"$USER"/yay || exit
makepkg -si --noconfirm
cd /home/"$USER"/ || exit
rm -rf yay
echo "install yay success"
}