Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(just): combine devmode on/off with gum #685

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions just/custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,8 @@ cockpit:
code-profile:
xdg-open https://vscode.dev/profile/github/c761b7738e9a7b02286d6d94cb2d1ecd

# Rebase to a stock Bluefin image
devmode-off:
#!/usr/bin/env bash
CURRENT_IMAGE=$(rpm-ostree status -b --json | jq -r '.deployments[0]."container-image-reference"')
if grep -q "bluefin-dx" <<< $CURRENT_IMAGE
then
echo "Rebasing to a non developer image"
NEW_IMAGE=$(echo $CURRENT_IMAGE | sed "s/bluefin-dx/bluefin/")
rpm-ostree rebase $NEW_IMAGE
else
echo "You are currently not on a developer image"
fi

# Rebase to the Bluefin Developer Experience image
devmode-on:
# Toggle between Bluefin and the Developer Experience
devmode:
#!/usr/bin/env bash
CURRENT_IMAGE=$(rpm-ostree status -b --json | jq -r '.deployments[0]."container-image-reference"')

Expand All @@ -67,11 +54,34 @@ devmode-on:

if grep -q "bluefin-dx" <<< $CURRENT_IMAGE
then
echo "You are already on a developer image"
CURRENT_STATE="enabled"
else
echo "Rebasing to a developer image"
NEW_IMAGE=$(echo $CURRENT_IMAGE | sed "s/bluefin/bluefin-dx/")
rpm-ostree rebase $NEW_IMAGE
CURRENT_STATE="disabled"
fi

echo "Developer mode is currently ${CURRENT_STATE}"
echo "Enable or Disable developer mode"
OPTION=$(gum choose Enable Disable)
if [ "$OPTION" = "Enable" ]
then
if grep -q "bluefin-dx" <<< $CURRENT_IMAGE
then
echo "You are already on a developer image"
else
echo "Rebasing to a developer image"
NEW_IMAGE=$(echo $CURRENT_IMAGE | sed "s/bluefin/bluefin-dx/")
rpm-ostree rebase $NEW_IMAGE
fi
elif [ "$OPTION" = "Disable" ]
then
if grep -q "bluefin-dx" <<< $CURRENT_IMAGE
then
echo "Rebasing to a non developer image"
NEW_IMAGE=$(echo $CURRENT_IMAGE | sed "s/bluefin-dx/bluefin/")
rpm-ostree rebase $NEW_IMAGE
else
echo "You are currently not on a developer image"
fi
fi

# Assemble a Pytorch distrobox (Nvidia only)
Expand Down
Loading