Closed H0mire closed 1 month ago
Generally this script choose the files under $base
which does not have a exact same file with md5 hash under $home
, and prompt whether to sync them, right?
I won't talk about the problem that you did not use set -e
and either mkdir -p
or equivalent, but the key point is that:
rsync
with --checksum
. You don't have to compare md5sum manually at all.exit
.Though I guess it's possible to implement similar function for ./install.sh
, such as using --no-overwrite
. I'll work on it when I'm available.
Thanks for your contribution anyway.
Closing.
My apologies, I rechecked the logic and I've found that the position of git pull
matters.
So, if a file is different with the destination before git pull
, the script assume it's "modified", which means it may contain some useful changes from the user, so user should be allowed to skip such file after git pull
and sync them.
The problem is that the script is not robust, such as:
git pull
were used to update this repository after that till now."
.config/ags/scripts/color_generation/applycolor.sh
, not by users.[y/n]
for all of them or none of them.git pull
may fail when a force push has happened in remote repo.set -e
at the beginning to make the script abort.And for the exclusion paths, you only considered .config/hypr/custom
but .config/ags/user_options.js
and .config/hypr/hyprland.conf
should also be excluded. Note that they are files, not folders.
If you can solve these problem, I think it's OK to be merged.
Thank you for your feedback.
@clsty I updated the script. Could you please review the script again?
Thanks!
The git clone
part has some major problems.
--depth=1
for git clone
.find "$temp_folder/$folder" -type f -print0 | while IFS= read -r -d '' file; do
will give you a $file
var which looks like ./cache/tmp.rhqpeLo6Zw/.config/ags/...
, you surely don't want that ./cache/tmp.rhqpeLo6Zw
thing, else $HOME/$file
will be messed up.Another problem is that you need to prompt user what this script is for, and give user chance to exit in case they run this by accident.
As for the rest part, after reading through it, it seems OK to me, but I don't have a suitable environment to test it, so I can't tell if there're more problems.
Nor have you tested it, right? Else I would not have found out the major problems above.
I suggest you to use it by yourself for a couple of days so you will be able to fix/improve some neglected things, if there is any.
@end-4 What do you think about this script?
Good job, great awareness. Makes sense. I tested it, but seems like the wrong way, lol. Thanks, working on it...
Ordered, delivered. Can you check? @end-4 and @clsty
Update: Tested now by resetting to an earlier commit. Tested Cases:
@end-4 What do you think about this script?
@clsty I don't see any problem Just gonna comment that the grammar/wording is good xd Since this is a scripting-related PR I'll let you decide when to merge
@clsty It's been a while. Anything that must be improved? Encountered no error since.
I can't find out any problem for now, so I'll merge it. Thank you for contribution.
Automatically updates the Repository and the dots: Replaces by default .config and .local files in the home directory. Checks if user has modified files => Asking before replacing modified files. You are able to exclude folders from updating. e.g. the "custom" folder Implemented with Checksums.