File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1111,13 +1111,14 @@ def setIcon(filePath, icnsPath):
11111111 Set the custom icon for the specified file or directory.
11121112 """
11131113
1114- toolPath = os .path .join (os .path .dirname (__file__ ), "seticon.app/Contents/MacOS/seticon" )
1115- dirPath = os .path .dirname ( __file__ )
1114+ dirPath = os .path .normpath (os .path .dirname (__file__ ))
1115+ toolPath = os .path .join ( dirPath , "seticon.app/Contents/MacOS/seticon" )
11161116 if not os .path .exists (toolPath ) or os .stat (toolPath ).st_mtime < os .stat (dirPath + '/seticon.m' ).st_mtime :
11171117 # NOTE: The tool is created inside an .app bundle, otherwise it won't work due
11181118 # to connections to the window server.
1119- if not os .path .exists ('seticon.app/Contents/MacOS' ):
1120- os .makedirs ('seticon.app/Contents/MacOS' )
1119+ appPath = os .path .join (dirPath , "seticon.app/Contents/MacOS" )
1120+ if not os .path .exists (appPath ):
1121+ os .makedirs (appPath )
11211122 runCommand ("cc -o %s %s/seticon.m -framework Cocoa" % (
11221123 shellQuote (toolPath ), shellQuote (dirPath )))
11231124
You can’t perform that action at this time.
0 commit comments