-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsymlink.sh
More file actions
executable file
·34 lines (27 loc) · 1019 Bytes
/
Copy pathsymlink.sh
File metadata and controls
executable file
·34 lines (27 loc) · 1019 Bytes
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
34
#!/bin/bash
# Get the current version from info.json
VERSION=$(jq -r '.version' info.json)
FACTORIO_MODS_DIR="$HOME/Library/Application Support/factorio/mods"
MOD_NAME="BlackMarket2"
echo "Setting up development symlink for $MOD_NAME v$VERSION"
# Remove any existing zip files for this mod
echo "Removing existing zip files..."
rm -f "$FACTORIO_MODS_DIR/${MOD_NAME}_"*.zip
# Remove any existing symlinks
echo "Removing existing symlinks..."
rm -f "$FACTORIO_MODS_DIR/${MOD_NAME}_"*
# Create the symlink with the current version
SYMLINK_NAME="${MOD_NAME}_${VERSION}"
SYMLINK_PATH="$FACTORIO_MODS_DIR/$SYMLINK_NAME"
echo "Creating symlink: $SYMLINK_PATH -> $(pwd)"
ln -sf "$(pwd)" "$SYMLINK_PATH"
# Verify the symlink was created
if [ -L "$SYMLINK_PATH" ]; then
echo "✅ Symlink created successfully!"
echo "🎯 You can now test your mod in Factorio"
echo "📁 Symlink: $SYMLINK_PATH"
echo "🔗 Points to: $(readlink "$SYMLINK_PATH")"
else
echo "❌ Failed to create symlink"
exit 1
fi