1
Fork 0

package and manifest are dynamically generated now!

This commit is contained in:
Jake Howard 2015-08-28 14:05:59 +01:00
parent 6331fc8a99
commit 00fe5df5b8
5 changed files with 27 additions and 50 deletions

4
.gitignore vendored
View file

@ -2,10 +2,14 @@
chrome/key.pem
chrome/data
chrome/*.crx
chrome/manifest.json
# Firefox extension files
firefox/data
firefox/*.xpi
firefox/package.json
# Source
build/

View file

@ -5,10 +5,12 @@ current_dir = os.path.dirname(os.path.realpath(__file__)) + "/"
with open(current_dir + "../package.json") as json_file:
project_package = json.load(json_file)
with open(current_dir + "manifest.json") as json_file:
manifest = json.load(json_file)
manifest = {}
try:
with open(current_dir + "manifest.json") as json_file:
manifest = json.load(json_file)
except:
manifest = {}
switcher = {
'name': 'name',
@ -36,6 +38,8 @@ for site in site_decoder:
manifest['content_scripts'] = content_scripts
# Hard coded things
manifest['mannifest_version'] = 2
with open(current_dir + 'manifest.json', 'w') as file:
json.dump(manifest, file, indent=2, sort_keys=True)

View file

@ -1,28 +0,0 @@
{
"content_scripts": [
{
"js": [
"data/lib/jquery.js",
"data/injector.js",
"data/injections/facebook.js"
],
"matches": [
"*://facebook.com/*"
]
},
{
"js": [
"data/lib/jquery.js",
"data/injector.js",
"data/injections/github.js"
],
"matches": [
"*://github.com/*"
]
}
],
"description": "Use hipchat emoticons on other websites. Some sites may require this plugin in order to see the emoticons.",
"manifest_version": 2,
"name": "Hipchat-Emoticons-for-all",
"version": "0.0.0"
}

View file

@ -5,8 +5,12 @@ current_dir = os.path.dirname(os.path.realpath(__file__)) + "/"
with open(current_dir + "../package.json") as json_file:
project_package = json.load(json_file)
with open(current_dir + "package.json") as json_file:
ext_package = json.load(json_file)
package = {}
try:
with open(current_dir + "package.json") as json_file:
package = json.load(json_file)
except:
package = {}
switcher = {
'name': 'title',
@ -17,7 +21,14 @@ switcher = {
}
for key, value in switcher.items():
ext_package[value] = project_package[key]
package[value] = project_package[key]
#Hard coded values
package['name'] = package['title'].replace(' ', '-')
package['id'] = package['name'] + "@jetpack"
package['engines'] = {'fennec': ">=38.01a", 'firefox': ">=38.0a1"}
package['main'] = 'index.js'
with open(current_dir + 'package.json', 'w') as file:
json.dump(ext_package, file, indent=2, sort_keys=True)
json.dump(package, file, indent=2, sort_keys=True)

View file

@ -1,14 +0,0 @@
{
"author": "TheOrangeOne",
"description": "Use hipchat emoticons on other websites. Some sites may require this plugin in order to see the emoticons.",
"engines": {
"fennec": ">=38.0a1",
"firefox": ">=38.0a1"
},
"id": "Hipchat-Emoticons-for-all@jetpack",
"license": "MIT",
"main": "index.js",
"name": "hipchat emoticons for all",
"title": "Hipchat-Emoticons-for-all",
"version": "0.0.0"
}