@@ -80,9 +80,9 @@ def __init__(self, profile_directory=None):
80
80
os .chmod (self .profile_dir , 0o755 )
81
81
self ._read_existing_userjs (os .path .join (self .profile_dir , "user.js" ))
82
82
self .extensionsDir = os .path .join (self .profile_dir , "extensions" )
83
- os .chmod (self .extensionsDir , 0o755 )
84
83
self .userPrefs = os .path .join (self .profile_dir , "user.js" )
85
- os .chmod (self .userPrefs , 0o644 )
84
+ if os .path .isfile (self .userPrefs ):
85
+ os .chmod (self .userPrefs , 0o644 )
86
86
87
87
# Public Methods
88
88
def set_preference (self , key , value ):
@@ -276,11 +276,11 @@ def _install_extension(self, addon, unpack=True):
276
276
assert addon_id , 'The addon id could not be found: %s' % addon
277
277
278
278
# copy the addon to the profile
279
- extensions_path = os .path .join (self .profile_dir , 'extensions' )
280
- addon_path = os .path .join (extensions_path , addon_id )
279
+ addon_path = os .path .join (self .extensionsDir , addon_id )
281
280
if not unpack and not addon_details ['unpack' ] and xpifile :
282
- if not os .path .exists (extensions_path ):
283
- os .makedirs (extensions_path )
281
+ if not os .path .exists (self .extensionsDir ):
282
+ os .makedirs (self .extensionsDir )
283
+ os .chmod (self .extensionsDir , 0o755 )
284
284
shutil .copy (xpifile , addon_path + '.xpi' )
285
285
else :
286
286
if not os .path .exists (addon_path ):
0 commit comments