From 86971f601754c7e3a230889d7bf0ceec525bd62c Mon Sep 17 00:00:00 2001 From: primeapple Date: Mon, 27 Nov 2023 21:34:00 +0100 Subject: [PATCH] Fixing bootstrap --- .config/yadm/bootstrap.d/fish | 13 +++++++------ .github/Dockerfile | 4 ++-- .github/workflows/yadm-test.yml | 5 ----- .github/yadm-test.sh | 14 +++++++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.config/yadm/bootstrap.d/fish b/.config/yadm/bootstrap.d/fish index b2d4996..1906e53 100755 --- a/.config/yadm/bootstrap.d/fish +++ b/.config/yadm/bootstrap.d/fish @@ -1,10 +1,11 @@ #!/bin/bash -# settings shell to fish, if it isn't yet -# CURRENT_SHELL=${SHELL##*/} -# if [[ ! "$CURRENT_SHELL" == "fish" ]]; then - # chsh -s "/bin/fish" -# fi +# setting default shell to fish, if it isn't yet +if [ $(basename "$SHELL") != "fish" ]; then + echo "Setting default shell to fish" + chsh -s $(which fish) +fi + # adding .bin folder to path fish -c " @@ -16,7 +17,7 @@ end # adding nice fish greeting fish -c "set -U fish_greeting 'Welcome to fish 🐟'" fish -c "set -U fish_features qmark-noglob" -fish -c "fish_config theme save kanagawa" +fish -c "echo y | fish_config theme save kanagawa" # TODO: this does not work yet, it sometimes adds weird filenames to the fish_plugins file # # manage fisher plugins, this should normally work through the fish_plugins file, but sadly does not diff --git a/.github/Dockerfile b/.github/Dockerfile index 28c67cf..8d7e526 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,7 +1,7 @@ FROM archlinux:base RUN pacman -Syu --noconfirm \ - && pacman -S --noconfirm fish yadm + && pacman -S --noconfirm fish yadm which RUN useradd --create-home --shell /bin/bash primeapple @@ -10,4 +10,4 @@ COPY yadm-test.sh yadm-test.sh RUN chmod +x yadm-test.sh && chown primeapple:primeapple yadm-test.sh USER primeapple -CMD ./yadm-test.sh +CMD ["sudo ./yadm-test.sh"] diff --git a/.github/workflows/yadm-test.yml b/.github/workflows/yadm-test.yml index 868fede..b057c5f 100644 --- a/.github/workflows/yadm-test.yml +++ b/.github/workflows/yadm-test.yml @@ -1,18 +1,13 @@ name: Yadm Test - on: push: - jobs: yadm-test: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v3 - - name: Build Docker image run: docker build -f .github/Dockerfile -t arch-yadm .github/ - - name: Run yadm-test script run: docker run --rm arch-yadm diff --git a/.github/yadm-test.sh b/.github/yadm-test.sh index 7bfb755..547121a 100755 --- a/.github/yadm-test.sh +++ b/.github/yadm-test.sh @@ -1,3 +1,7 @@ +#!/bin/bash + +set -eu + echo "## TEST: Cloning the dotfiles via YADM ##" yadm clone --no-bootstrap https://github.com/primeapple/dotfiles echo '## DONE' @@ -25,13 +29,13 @@ echo '## DONE' ############################################################################### -echo "##TEST: Executing bootstrap" +echo "## TEST: Executing bootstrap" yadm bootstrap echo '## DONE' ############################################################################### -echo "##TEST: README.md and LICENSE and .github/ should not be checked out" +echo "## TEST: README.md and LICENSE and .github/ should not be checked out" if [ -f "README.md" ]; then echo "Error: README.md should not be checked out." exit 1 @@ -50,8 +54,8 @@ echo '## DONE' ############################################################################### -echo "##TEST: fish is the default shell" -if [ "$(basename "$SHELL")" != "fish" ]; then +echo "## TEST: fish is the default shell" +if [ $(basename "$SHELL") != "fish" ]; then echo "Error: fish is not the default shell." exit 1 fi @@ -59,7 +63,7 @@ echo '## DONE' ############################################################################### -echo "##TEST: fisher is installed" +echo "## TEST: fisher is installed" if ! fish -c "fisher --version" >/dev/null 2>&1; then echo "Error: fisher is not installed." exit 1