Skip to content

Instantly share code, notes, and snippets.

@daniele-rapagnani
Created November 11, 2020 19:16
Show Gist options
  • Save daniele-rapagnani/ea2f610bf3ad76089fa3e6e633b0a11a to your computer and use it in GitHub Desktop.
Save daniele-rapagnani/ea2f610bf3ad76089fa3e6e633b0a11a to your computer and use it in GitHub Desktop.
A simple script to match Unity GUIDs to files. Useful when manually merging scenes.
#!/bin/bash
# Run inside a Unity project's root
if [ -z "$1" ]; then
echo "Usage: $0 guid" 1>&2
exit 1
fi
FILENAME=`grep -lr --include "*.scene" --include "*.meta" "^guid: $1$" . | head -n 1`
if [ -z "$FILENAME" ]; then
echo "GUID '$1' not found." 1>&2
exit 2
fi
FILENAME=${FILENAME%.meta}
FILENAME=${FILENAME%.scene}
echo "$FILENAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment