mirror of
https://github.com/elliotnunn/supermario.git
synced 2025-02-20 10:28:57 +00:00
37 lines
943 B
Plaintext
37 lines
943 B
Plaintext
# SetDirectory - set the default directory
|
|
#
|
|
# Usage:
|
|
# SetDirectory directory
|
|
#
|
|
# SetDirectory sets the default directory and adds the new default
|
|
# directory to the Directory menu if it is not already present.
|
|
#
|
|
#
|
|
# Copyright Apple Computer, Inc. 1987 - 1990
|
|
# All rights reserved.
|
|
|
|
Set Exit 0
|
|
If {#} != 1 OR "{1}" == ""
|
|
Echo "### {0} - A directory must be specified." > Dev:StdErr
|
|
Echo "# Usage - {0} directory" > Dev:StdErr
|
|
Exit 1
|
|
Else
|
|
Directory "{1}"
|
|
If {Status} != 0
|
|
Exit 2
|
|
End
|
|
Set directory `Directory`
|
|
|
|
if !`Evaluate "{directory}" =~ /?«0,64»/` # longer that 64 bytes?
|
|
Unset ®1 ; Unset ®2
|
|
(Evaluate "{directory}" =~ /([¬':']*)®1≈':'([¬':']+)®2':'/ ) ∑ dev:null
|
|
Set menuname "{®1}"':…:'"{®2}"
|
|
else
|
|
Set menuname "{directory}"
|
|
end
|
|
|
|
AddMenu Directory "{menuname}" ∂
|
|
'Directory "'"{directory}"'" > "{ShellDirectory}"MPW.Errors ≥ Dev:StdOut ∂
|
|
|| Alert < "{ShellDirectory}"MPW.Errors'
|
|
End
|