Skip to content

Commit

Permalink
Fixing bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
primeapple committed Nov 30, 2023
1 parent cd64e37 commit a2e6fa5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
13 changes: 7 additions & 6 deletions .config/yadm/bootstrap.d/fish
Original file line number Diff line number Diff line change
@@ -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 "
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM archlinux:base

RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm fish yadm
&& pacman -S --noconfirm fish sudo which yadm

RUN useradd --create-home --shell /bin/bash primeapple
RUN useradd --create-home --groups wheel --password password --shell /bin/bash primeapple

WORKDIR /home/primeapple
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 ["echo", "password", "|", "sudo", "-S", "./yadm-test.sh"]
5 changes: 0 additions & 5 deletions .github/workflows/yadm-test.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 9 additions & 5 deletions .github/yadm-test.sh
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -50,16 +54,16 @@ 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
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
Expand Down

0 comments on commit a2e6fa5

Please sign in to comment.