forked from aldostools/ps3mfw-builder-0.2.1-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppMain.tcl
37 lines (31 loc) · 997 Bytes
/
AppMain.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env wish8.5
#
# ps3mfw -- PS3 MFW creator
#
# Copyright (C) Anonymous Developers (Code Monkeys)
#
# This software is distributed under the terms of the GNU General Public
# License ("GPL") version 3, as published by the Free Software Foundation.
#
# MacOS X / Windows wrapper
#
# Mac OSX: Remove Cocoa argument from arglist
if {[string first "-psn" [lindex $argv 0]] == 0} { set argv [lrange $argv 1 end]}
#Source the main file
if { $::tcl_platform(platform) == "windows"} {
source [file join [pwd] ps3mfw]
} else {
#Set variable program_dir
set program_dir [file dirname [info script]]
set program [file tail [info script]]
while {[catch {file readlink [file join $program_dir $program]} program]== 0} {
if {[file pathtype $program] == "absolute"} {
set program_dir [file dirname $program]
} else {
set program_dir [file join $program_dir [file dirname $program]]
}
set program [file tail $program]
}
unset program
source [file join $program_dir ps3mfw]
}