Created
November 11, 2020 19:16
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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