Created
April 25, 2012 21:45
-
-
Save johnnyg/2493762 to your computer and use it in GitHub Desktop.
Allows you to manually upgrade the metadata files of gnome-shell extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Example usage: find ~/.local/share/gnome-shell/extensions/ -name 'metadata.json' -print0 | xargs -0 gnome-shell-extension-upgrade 3.4 | |
import json | |
import sys | |
new_version = unicode(sys.argv[1]) | |
for filename in sys.argv[2:]: | |
metadata = json.load(open(filename, "rb")) | |
if new_version not in metadata['shell-version']: | |
metadata['shell-version'].append(new_version) | |
json.dump(metadata, open(filename, "wb")) | |
print "Upgraded '%s' to '%s'" % (metadata['name'], new_version) | |
else: | |
print "'%s' is already up-to-date" % metadata['name'] | |
import json | |
import sys | |
new_version = unicode(sys.argv[1]) | |
for filename in sys.argv[2:]: | |
metadata = json.load(open(filename, "rb")) | |
if new_version not in metadata['shell-version']: | |
metadata['shell-version'].append(new_version) | |
json.dump(metadata, open(filename, "wb")) | |
print "Upgraded '%s' to '%s'" % (metadata['name'], new_version) | |
else: | |
print "'%s' is already up-to-date" % metadata['name'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment