Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added webstore bundler, minor version #

  • Loading branch information...
commit fcb66b0dafade6fceffb70d413b6c0235da6b148 1 parent bd8b7aa
@psawaya psawaya authored
Showing with 51 additions and 2 deletions.
  1. +2 −1  .gitignore
  2. +48 −0 bundle_for_webstore.py
  3. +1 −1  manifest.json
View
3  .gitignore
@@ -1,3 +1,4 @@
.DS_Store
todos.txt
-Mocks/*
+Mocks/*
+gombot-webstore.zip
View
48 bundle_for_webstore.py
@@ -0,0 +1,48 @@
+import json
+import os
+import shutil
+from subprocess import call, PIPE
+
+def bundle():
+ # Delete any existing temp directory
+ if os.path.isdir('temp'):
+ shutil.rmtree('temp')
+
+ # Copy this directory
+ shutil.copytree('.','temp')
+
+ # Delete git stuff in temp directory
+ if os.path.isdir('temp/.git'):
+ shutil.rmtree('temp/.git')
+
+ # Delete server code
+ shutil.rmtree('temp/server')
+
+ # Delete infobar manifest
+ os.unlink('temp/infobar/manifest.json')
+
+ # Update gombot manifest.json
+ changeManifest('temp/manifest.json')
+
+ # Zip up temp directory
+ call(['/usr/bin/zip', '-r', 'gombot-webstore', 'temp'], stdout=PIPE, stderr=PIPE)
+
+ # Delete temp directory
+ shutil.rmtree('temp')
+
+def changeManifest(manifestFilename):
+ manifestData = open(manifestFilename,'r').read()
+ manifest = json.loads(manifestData)
+ # Remove update_url, web store does its own updating
+ if manifest.get('update_url'):
+ del manifest['update_url']
+ # Bump up minor version number
+ version = map(int,manifest['version'].split('.'))
+ version[-1] += 1
+ manifest['version'] = '.'.join(map(str,version))
+ # Write out modified manifest
+ open(manifestFilename,'w').write(json.dumps(manifest))
+
+
+if __name__ == '__main__':
+ bundle()
View
2  manifest.json
@@ -1,7 +1,7 @@
{
"name": "Gombot",
"manifest_version": 2,
- "version": "0.1",
+ "version": "0.1.1",
"description": "Tired of remembering your usernames and passwords? Let Gombot do the work for you!",
"permissions": [
"tabs",
Please sign in to comment.
Something went wrong with that request. Please try again.