Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

Commit

Permalink
support update of core
Browse files Browse the repository at this point in the history
  • Loading branch information
blauerberg committed Jan 23, 2017
1 parent d0e2335 commit 9992243
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ $ cd {your_drupal_site_root}
# show help message
$ /path/to/drush-scm upc -h
# update all modules to lastest version
# update all modules except core to lastest version
$ /path/to/drush-scm upc
# update only Drupal core
$ /path/to/drush-scm upc --module drupal
# update only panels
$ /path/to/drush-scm upc --module panels
Expand Down
18 changes: 13 additions & 5 deletions drush-scm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def upc(args, config):
start = update_status.index("{")
json_status = json.loads(update_status[update_status.index("{"):])
modules = json_status.keys()
modules.remove("drupal")
if args.module == 'all' or args.module != 'drupal':
modules.remove("drupal")

for module in modules:
name = json_status[module]["name"]
Expand All @@ -51,11 +52,18 @@ def upc(args, config):
cmd = drush + " upc -y %(name)s %(version)s" % locals()
subprocess.call(cmd, shell=True, stderr=DEVNULL)

cmd = "git add -A %(path)s" % locals()
subprocess.call(cmd, shell=True, stdout=DEVNULL, stderr=DEVNULL)
if module != 'drupal':
cmd = "git add -A %(path)s" % locals()
subprocess.call(cmd, shell=True, stdout=DEVNULL, stderr=DEVNULL)

cmd = 'git commit -m "%(name)s: update to %(version)s for security\n\n%(release_link)s"' % locals()
subprocess.call(cmd, shell=True, stdout=DEVNULL, stderr=DEVNULL)
cmd = 'git commit -m "%(name)s: update to %(version)s for security\n\n%(release_link)s"' % locals()
subprocess.call(cmd, shell=True, stdout=DEVNULL, stderr=DEVNULL)
else:
print "Drupal core updated to %s, but the git reopsitory hasn't been updated yet because some confirmation is required." % (version)
print "Please check the following article and manually update the git repository."
print "For Drupal 8: https://www.drupal.org/docs/8/update/update-procedure-in-drupal-8"
print "For Drupal 7: https://www.drupal.org/docs/7/updating-your-drupal-site/how-to-update-drupal-core"
sys.exit(0)

parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
Expand Down

0 comments on commit 9992243

Please sign in to comment.