Skip to content

Instantly share code, notes, and snippets.

@lewis-carson
Last active February 28, 2018 07:31
Show Gist options
  • Save lewis-carson/bbfcb8b19732b2d8eb43672a9f002a8c to your computer and use it in GitHub Desktop.
Save lewis-carson/bbfcb8b19732b2d8eb43672a9f002a8c to your computer and use it in GitHub Desktop.
util = require('util');
require('util.promisify').shim();
exec = util.promisify(require('child_process').exec);
atom.commands.add 'atom-text-editor', 'blog:publish', ->
editor = atom.workspace.getActivePaneItem()
file = editor?.buffer.file.path.split('\\')
file.splice(-1,1)
{ stdout, stderr } = exec("cd #{file.join('\\')} && git add * && git commit * -m \"Updated blog\" && git push");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment