mirror of
https://github.com/elliotnunn/BuildCubeE.git
synced 2026-01-23 19:16:18 +00:00
54 lines
1.0 KiB
Plaintext
54 lines
1.0 KiB
Plaintext
# OrphanFiles - Remove the ckid resource from a list of files.
|
|
#
|
|
# Usage: OrphanFile files…
|
|
#
|
|
# OrphanFile removes the ckid resource (if it exists) from a
|
|
# list of files.
|
|
#
|
|
# © Apple Computer, Inc. 1988 - 1993
|
|
# All rights reserved.
|
|
|
|
Set Echo 0
|
|
Set Exit 0
|
|
Unset CaseSensitive
|
|
|
|
# Check the parameters
|
|
|
|
If {#} == 0
|
|
Echo "### Usage - {0} files…" > dev:stderr
|
|
Exit 1
|
|
End
|
|
|
|
|
|
For name in {"parameters"}
|
|
Begin
|
|
If "`Exists -f "{name}"`" != ""
|
|
Set path `Files -fr "{name}"`
|
|
Set wind 0
|
|
For i in `Windows`
|
|
If "{path}" =~ /"{i}"/ ## Make NOT case-sensitive
|
|
Set wind 1
|
|
Break
|
|
End
|
|
End
|
|
Echo "Delete 'ckid';" | Rez -a -m -o "{name}" -noResolve output
|
|
If {wind}
|
|
If "{path}" =~ /"{active}"/
|
|
Close "{name}"
|
|
Open "{name}"
|
|
Else
|
|
Close "{name}"
|
|
Target "{name}"
|
|
End
|
|
End
|
|
Else
|
|
If "`Exists -d "{name}"`" == ""
|
|
Echo "### {0}" - File "'{name}'" does not exist. >> dev:stderr
|
|
Exit 2
|
|
Else
|
|
Echo "### {0}" - File "'{name}'" is a folder and was ignored. >> dev:stderr
|
|
End
|
|
End
|
|
End
|
|
End
|