Script / Delete
script-deleteDelete a Godot script (.cs or .gd) from res:// and remove its .uid sidecar. Verify references first because linked nodes/resources will break.
Instructions
Delete a Godot script file (C# '.cs' or GDScript '.gd') from the res:// filesystem. Fails if no file exists at the path. The script's identity (path, language) is captured BEFORE deletion and returned for confirmation. The file is removed with DirAccess, along with its Godot '.uid' sidecar when present, then the editor filesystem is rescanned and (for a '.cs' file) BOUNDED-settles. WARNING: nodes/resources referencing the deleted script will break — verify with 'script-read' first. A loaded copy is detached from the path, so an open scene still using it embeds it on its next save. Returns a structured ScriptInfo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scriptPath | Yes | res:// path of the script file to delete, ending in '.cs' or '.gd'. |