You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
985 B
27 lines
985 B
#!/bin/sh |
|
|
|
# This "mark location" spell allows you to mark the current directory or file as the destination for a portal. |
|
# To create a portal, navigate to the destination folder or file and cast this spell, then navigate to the location where |
|
# you want to create the portal and cast the "create portal" spell. |
|
# If an argument is given, it will be used as the path to the destination file or directory. |
|
# If no argument is given, the current directory will be used as the destination. |
|
|
|
# Create ~/.mud direrctory if does not exist |
|
mkdir -p ~/.mud |
|
|
|
# Set the path to the marker file |
|
marker_file="$HOME/.mud/portal_marker" |
|
|
|
# Check if an argument was given |
|
if [ -z "$1" ]; then |
|
# If no argument was given, use the current directory as the destination |
|
destination="$(pwd)" |
|
else |
|
# If an argument was given, use it as the destination |
|
destination="$1" |
|
fi |
|
|
|
# Save the destination path to the marker file |
|
echo "$destination" > "$marker_file" |
|
|
|
echo "Location marked at $destination."
|
|
|