Last active
February 28, 2018 07:31
-
-
Save lewis-carson/bbfcb8b19732b2d8eb43672a9f002a8c to your computer and use it in GitHub Desktop.
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
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