Last active
September 12, 2018 02:14
-
-
Save tehpsalmist/fee4b6b5d22ec366381092f7b47b88db 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
const chokidar = require('chokidar') | |
const { exec } = require('child_process') | |
const frontend = chokidar.watch([ | |
'./plugins/**/*', | |
'./maya.json' | |
], { ignored: ['./plugins/*/node_modules', './plugins/*/build/**.*'] }) | |
frontend.on('ready', () => console.log('I am at your service, my liege.')) | |
frontend.on('change', (path) => { | |
console.log('redeploying') | |
exec('mayan deploy --frontend', { shell: '/bin/zsh' }, (err, stdout, stderr) => { | |
if (err) console.error('err:', err) | |
if (stdout) console.log('stdout:', stdout) | |
if (stderr) console.error('stderr:', stderr) | |
if (!err && !stderr) console.log('Successfully Deployed at', new Date().toLocaleString()) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment