mirror of
https://github.com/danielepintore/os-configurer.git
synced 2026-06-15 20:25:13 +02:00
Fix if statement conditions and force dotfile checkout (not clone)
This commit is contained in:
@@ -10,7 +10,7 @@ if ! sudo snapper -c root get-config &> /dev/null; then
|
||||
echo -e "\e[31m❌ Error: Snapper create-config failed. Trying auto fix by deleting the old subvolume.\e[0m" >&2
|
||||
# Removes the submodule already created and re-create it from snapper
|
||||
# I can use mount -a since the fstab doens't use subvolume id
|
||||
if ! sudo umount /.snapshots/ && sudo rmdir /.snapshots/ && sudo snapper --config root create-config / &> /dev/null && sudo mount -a; then
|
||||
if ! (sudo umount /.snapshots/ && sudo rmdir /.snapshots/ && sudo snapper --config root create-config / &> /dev/null && sudo mount -a); then
|
||||
echo -e "\e[31m❌ Error: Snapper create-config failed. Please refer to wiki. Probably the subvolume already exists. Manual intervation needed.\e[0m" >&2
|
||||
exit -1
|
||||
fi
|
||||
|
||||
@@ -5,8 +5,11 @@ echo -e "\e[31m❌ Manual intervation needed: please be sure to add your ssh key
|
||||
echo -e "\e[31mPress any key to continue\e[0m" >&2
|
||||
read -r
|
||||
cd $HOME
|
||||
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
|
||||
echo ".cfg" >> .gitignore
|
||||
if ! git clone --bare git@github.com:danielepintore/dotfiles.git $HOME/.cfg && config checkout && config config --local status.showUntrackedFiles no; then
|
||||
if ! (git clone --bare git@github.com:danielepintore/dotfiles.git $HOME/.cfg &&
|
||||
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME checkout -f &&
|
||||
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME config --local status.showUntrackedFiles no); then
|
||||
echo -e "\e[31m❌ Manual intervation needed: failed to setup your dotfiles.\e[0m" >&2
|
||||
echo -e "\e[31mPress any key to continue\e[0m" >&2
|
||||
read -r
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user