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

chore: clean-up dotfiles from home dir #794

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 15 additions & 3 deletions dx/usr/bin/bluefin-dx-user-vscode
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
#!/usr/bin/env bash

# SCRIPT VERSION
USER_SETUP_VER=1
USER_SETUP_VER_FILE="$HOME/.bluefin-vscode-configured"
USER_SETUP_VER=2
USER_SETUP_VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/vscode-configured"
USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")

mkdir -p "$(dirname "$USER_SETUP_VER_FILE")" || exit 1

USER_SETUP_VER_FILE_V1="$HOME/.bluefin-vscode-configured"
# Upgrade from v1 to v2 changes only the location of the USER_SETUP_VER.
# Exit if v1 file is present.
if [[ -f $USER_SETUP_VER_FILE_V1 ]]; then
echo "User setup v1 has already run. Exiting..."
rm $USER_SETUP_VER_FILE_V1
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
exit 0
fi

# Run script if updated
if [[ -f $USER_SETUP_VER_FILE && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; then
echo "User setup has already run. Exiting..."
echo "User setup v$VER has already run. Exiting..."
exit 0
fi

Expand Down
16 changes: 14 additions & 2 deletions usr/bin/ublue-user-flatpak-manager
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
#!/usr/bin/env bash

# Script Version
VER=1
VER_FILE="$HOME/.ublue_flatpak_manager_version"
VER=2
VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/flatpak_manager_version"
VER_RAN=$(cat $VER_FILE)

mkdir -p "$(dirname "$VER_FILE")" || exit 1

# Upgrade from v1 to v2 changes only the location of the VER_FILE.
# Exit if v1 file is present.
VER_1_FILE="$HOME/.ublue_flatpak_manager_version"
if [[ -f $VER_1_FILE ]]; then
echo "Flatpak manager v1 has already ran. Exiting..."
rm $VER_1_FILE
echo $VER > $VER_FILE
exit 0
fi

# Run script if updated
if [[ -f $VER_FILE && $VER = $VER_RAN ]]; then
echo "Flatpak manager v$VER has already ran. Exiting..."
Expand Down
20 changes: 17 additions & 3 deletions usr/bin/ublue-user-setup
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
#!/usr/bin/env bash

# SCRIPT VERSION
USER_SETUP_VER=1
USER_SETUP_VER_FILE="$HOME/.ublue-configured"
USER_SETUP_VER=2
USER_SETUP_VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/user-setup"
USER_SETUP_VER_RAN=$(cat $USER_SETUP_VER_FILE)

mkdir -p "$(dirname "$USER_SETUP_VER_FILE")" || exit 1

echo "$(dirname "$USER_SETUP_VER_FILE")"

# Upgrade from v1 to v2 changes only the location of the USER_SETUP_VER.
# Exit if v1 file is present.
USER_SETUP_VER_FILE_V1="$HOME/.ublue-configured"
if [[ -f $USER_SETUP_VER_FILE_V1 ]]; then
echo "User setup v1 has already run. Exiting..."
rm $USER_SETUP_VER_FILE_V1
echo $USER_SETUP_VER > $USER_SETUP_VER_FILE
exit 0
fi

# Run script if updated
if [[ -f $USER_SETUP_VER_FILE && $USER_SETUP_VER = $USER_SETUP_VER_RAN ]]; then
echo "User setup has already run. Exiting..."
echo "User setup v$VER has already run. Exiting..."
exit 0
fi

Expand Down