forked from meltylabs/melty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy_settings.sh
33 lines (27 loc) · 845 Bytes
/
copy_settings.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Source and destination directories using $HOME
SRC_DIR="$HOME/Library/Application Support/Code/User"
DEST_DIR="$HOME/Library/Application Support/melty/User"
# Files to copy
FILES=("keybindings.json" "settings.json")
# Create destination directory if it doesn't exist
mkdir -p "$DEST_DIR"
# Copy each file
for file in "${FILES[@]}"; do
if [ -f "$SRC_DIR/$file" ]; then
cp "$SRC_DIR/$file" "$DEST_DIR/$file"
echo "Copied $file to $DEST_DIR"
else
echo "Warning: $file not found in $SRC_DIR"
fi
done
# Verify the copy operation
echo "Verifying copied files..."
for file in "${FILES[@]}"; do
if [ -f "$DEST_DIR/$file" ]; then
echo "$file successfully copied to Melty configuration directory"
else
echo "Error: $file was not copied successfully"
fi
done
echo "Done!"