-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Adding rsync to yarn run watch (#241)
- Loading branch information
Conrad Chan
authored
Oct 17, 2018
1 parent
c0bb9a2
commit afe6ab6
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ src/i18n/json | |
test/dev.html | ||
lib | ||
*~~bak | ||
functional-tests/output | ||
functional-tests/output | ||
build/rsync.json |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const execSync = require('child_process').execSync; | ||
|
||
function RsyncPlugin(source, destination) { | ||
this.source = source; | ||
this.destination = destination; | ||
} | ||
|
||
/* eslint-disable no-console */ | ||
RsyncPlugin.prototype.apply = function rsync(compiler) { | ||
compiler.plugin('done', () => { | ||
console.log(''); | ||
console.log(`🔄 🔄 🔄 Rsync starting for ${this.source} 🔄 🔄 🔄`); | ||
execSync(`rsync -avzq --exclude=".*" "${this.source}" "${this.destination}"`, { stdio: [0, 1, 2] }); | ||
}); | ||
}; | ||
|
||
module.exports = RsyncPlugin; |
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