Skip to content

Commit 218e8fe

Browse files
authored
feat: migrations (#1120)
# Pull Request ## Description as discussed on the discussion #1119 Please read these instructions and remove unnecessary text. - Try to include a summary of the changes and which issue is fixed. - Also include relevant motivation and context (if applicable). - Make sure to make PR against dev and not the master - List any dependencies that are required for this change. (e.g., packages or other PRs) - Provide a link if there is an issue related to this pull request. e.g., Fixes # (issue) - Please add Reviewers, Assignees, Labels, Projects, and Milestones to the PR. (if applicable) ## Type of change Please put an `x` in the boxes that apply: - [ ] **Bug fix** (non-breaking change which fixes an issue) - [x] **New feature** (non-breaking change which adds functionality) - [ ] **Breaking change** (fix or feature that would cause existing functionality to not work as expected) - [ ] **Documentation update** (non-breaking change; modified files are limited to the documentations) - [ ] **Technical debt** (a code change that does not fix a bug or add a feature but makes something clearer for devs) - [ ] **Other** (provide details below) ## Checklist Please put an `x` in the boxes that apply: - [x] I have read the [CONTRIBUTING](https://github.com/HyDE-Project/HyDE/blob/master/CONTRIBUTING.md) document. - [x] My code follows the code style of this project. - [x] My commit message follows the [commit guidelines](https://github.com/HyDE-Project/HyDE/blob/master/COMMIT_MESSAGE_GUIDELINES.md). - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added a changelog entry. - [ ] I have added necessary comments/documentation to my code. - [ ] I have added tests to cover my changes. - [ ] I have tested my code locally and it works as expected. - [ ] All new and existing tests passed. ## Screenshots (if appropriate) ## Additional context Add any other context about the problem here.
2 parents c0e6871 + f90db76 commit 218e8fe

File tree

4 files changed

+243
-203
lines changed

4 files changed

+243
-203
lines changed

Configs/.config/hyde/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Configuration file for HyDE
22
# Environment variables should be on top
33
# Updated config.toml file can be found at $HOME/.local/share/hyde/config.toml
4+
"$schema" = "https://raw.githubusercontent.com/HyDE-Project/HyDE/refs/heads/master/Configs/.local/share/hyde/schema/config.toml.json"

Scripts/install.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Usage: $0 [options]
7373
m : no the[m]e reinstallations
7474
t : [t]est run without executing (-irst to dry run all)
7575
76-
NOTE:
76+
NOTE:
7777
running without args is equivalent to -irs
7878
to ignore nvidia, run -irsn
7979
@@ -279,6 +279,34 @@ EOF
279279
"${scrDir}/install_pst.sh"
280280
fi
281281

282+
283+
#---------------------------#
284+
# run migrations #
285+
#---------------------------#
286+
if [ ${flg_Restore} -eq 1 ]; then
287+
288+
# migrationDir="$(realpath "$(dirname "$(realpath "$0")")/../migrations")"
289+
migrationDir="${scrDir}/migrations"
290+
291+
if [ ! -d "${migrationDir}" ]; then
292+
print_log -warn "Migrations" "Directory not found: ${migrationDir}"
293+
fi
294+
295+
echo "Running migrations from: ${migrationDir}"
296+
297+
if [ -d "${migrationDir}" ] && find "${migrationDir}" -type f | grep -q .; then
298+
migrationFile=$(find "${migrationDir}" -maxdepth 1 -type f -printf '%f\n' | sort -r | head -n 1)
299+
300+
if [[ -n "${migrationFile}" && -f "${migrationDir}/${migrationFile}" ]]; then
301+
echo "Found migration file: ${migrationFile}"
302+
sh "${migrationDir}/${migrationFile}"
303+
else
304+
echo "No migration file found in ${migrationDir}. Skipping migrations."
305+
fi
306+
fi
307+
308+
fi
309+
282310
#------------------------#
283311
# enable system services #
284312
#------------------------#

Scripts/migrations/v25.8.2.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
if command -v hyde-shell >/dev/null 2>&1; then
4+
echo "Reloading Hyde shell shaders..."
5+
hyde-shell shaders --reload
6+
fi

0 commit comments

Comments
 (0)