Initial shellrc commit.

This commit is contained in:
rto
2026-05-06 11:49:16 +02:00
commit ac1525c172
6 changed files with 259 additions and 0 deletions
Executable
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
MAP_FILE=".sync-map"
if [ ! -f "$MAP_FILE" ]; then
echo "No .sync-map found"
exit 1
fi
echo "Syncing external files INTO repo..."
while IFS=: read -r src dest
do
eval source_file="$src"
eval dest_file="$dest"
# skip empty or comment lines
[ -z "$source_file" ] && continue
case "$source_file" in \#*) continue ;; esac
if [ ! -f "$dest_file" ]; then
echo "Missing external file: $dest_file"
exit 1
fi
if [ ! -d "$(dirname "$source_file")" ]; then
mkdir -p "$(dirname "$source_file")"
fi
cp "${dest_file}" "${source_file}"
echo "Restored: $dest_file"
done < "$MAP_FILE"
echo "Done syncing OUT"