Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Rsync.plugin should update files rather than delete and replace #327

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/RsyncPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RsyncPlugin.prototype.apply = function rsync(compiler) {
compiler.plugin('done', () => {
console.log('');
console.log(`🔄 🔄 🔄 Rsync starting for ${this.source} 🔄 🔄 🔄`);
execSync(`rsync -avz --delete --exclude=".*" "${this.source}" "${this.destination}"`, { stdio: [0, 1, 2] });
Copy link
Contributor

@tonyjin tonyjin Aug 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this can potentially result in a lot of cruft if you change file names around or do some larger configuration change. Hypothetical, but this could cause a situation in which you can cause an error by changing the name of a referenced file but then not updating the name in code. Rsync wouldn't delete the old file on your VM, so your dev environment might still work, but would then break in staging/production.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm good point. Let me look into alternative setups

execSync(`rsync -avz --update --exclude=".*" "${this.source}" "${this.destination}"`, { stdio: [0, 1, 2] });
});
};

Expand Down