зеркало из https://github.com/mozilla/FlightDeck.git
* create package directory if it doesn't exist before saving package.json
* log critical if saving manifest failed
This commit is contained in:
Родитель
602c48d6e3
Коммит
d050e9f2dd
|
@ -288,10 +288,17 @@ class Repackage(object):
|
|||
log.debug('Writing manifest %s, %s' % (os.path.join(
|
||||
sdk_dir, 'packages', package_name, 'package.json'),
|
||||
self.manifest))
|
||||
with open(os.path.join(
|
||||
sdk_dir, 'packages', package_name, 'package.json'),
|
||||
'w') as manifest:
|
||||
manifest.write(simplejson.dumps(self.manifest))
|
||||
package_dir = os.path.join(
|
||||
sdk_dir, 'packages', package_name)
|
||||
if not os.path.isdir(package_dir):
|
||||
log.warning("Package dir (%s) does not exist")
|
||||
os.makedirs(package_dir)
|
||||
try:
|
||||
with open(os.path.join(package_dir, 'package.json'), 'w') as manifest:
|
||||
manifest.write(simplejson.dumps(self.manifest))
|
||||
except:
|
||||
log.critical("Manifest couldn't be exported to %s" % package_path)
|
||||
|
||||
return sdk_dir
|
||||
|
||||
def cleanup(self):
|
||||
|
|
Загрузка…
Ссылка в новой задаче