mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 08:50:12 -08:00
20 lines
616 B
Bash
Executable File
20 lines
616 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Define the paths to the source and destination files
|
|
source_file="/home/acedanger/dotfiles/.zshrc"
|
|
destination_file="/home/acedanger/.zshrc"
|
|
|
|
# Get the modification times of the source and destination files
|
|
source_mtime=$(stat -c %Y "$source_file")
|
|
destination_mtime=$(stat -c %Y "$destination_file")
|
|
|
|
# Compare the modification times
|
|
if [ "$source_mtime" -gt "$destination_mtime" ]; then
|
|
echo "Updating '$destination_file' with '$source_file'..."
|
|
cp "$source_file" "$destination_file"
|
|
# source $destination_file
|
|
echo "The ~/.zshrc has been updated and the changes are now active."
|
|
fi
|
|
|
|
exit 0
|