dynamicdan / sn-filesync

2-way sync ServiceNow field values to local files
MIT License
66 stars 37 forks source link

Added optional 'ignoreFiles' config parameter #11

Closed dwightgunning closed 8 years ago

dwightgunning commented 8 years ago

The ability to specify a custom File Ignore pattern would be useful.

dwightgunning commented 8 years ago

I just forked and created a quick PR for a tweak I needed. If you'd like more context or adjustments to better document the change or PR, just let me know.

dynamicdan commented 8 years ago

Nice and simple. Thanks for the contribution!

dwightgunning commented 8 years ago

I just realised this opens up the possibility for a nasty scenario where the ".sync_data" folder ends up being included in the chokidar watch list.

I ought to fix this. Suggestions: 1) Further PR that will concat the ignoreFiles array with "*/.syncdata/" will ensure that the .sync_data folder is _never** watched. I don't think there'd be any situation where this folder should be watched and sync'd. 2) Provide a mega-warning in the README.

dynamicdan commented 8 years ago

We might need to double check your use case. I'm guessing your IDE is saving some kind of "project" file that you want to ignore? If so then one can use this folder setup:

project/ project/records/

Where the project file is saved in project/ and the config syncs the files in the sub-folders in the project/records/ folder.

Do you have some example use cases to share?

dwightgunning commented 8 years ago

My preference is to rename 'records' to '.records'.

The reason for this is that I have a gulp build pipeline to generate those records. The record files wont typically be edited directly and I won't have them under revision control.

So a dot.filename makes sense. On 25 Nov 2015 9:43 a.m., "dynamicdan" notifications@github.com wrote:

We might need to double check your use case. I'm guessing your IDE is saving some kind of "project" file that you want to ignore? If so then one can use this folder setup:

project/ project/records/

Where the project file is saved in project/ and the config syncs the files in the sub-folders in the project/records/ folder.

Do you have some example use cases to share?

— Reply to this email directly or view it on GitHub https://github.com/dynamicdan/filesync/pull/11#issuecomment-159535663.

dynamicdan commented 8 years ago

That's interesting. So you don't actually want to sync any files/fields back to the instance record? That's kind of the main point of FileSync. Are you then building some kind of archive/review system? If so, are you aware of the new --search option? Perhaps you can automate what you want to pull down as record fields to files using search without having the watcher run?

In any case, feel free to submit a new PR to add the .sync_data to the array (inc README update).

dwightgunning commented 8 years ago

I probably didn't explain that well. The intention is definitely to sync with the SNOW instance. The point is that the files that are being sync'd are actually preprocessed, minified, uglified etc. So the files to be synchronised aren't edited by hand, they're an artifact/output of an automated build pipeline. Therefore they don't belong under source control and they don't need to be visible in the context of the "project".

I do need to check out the Search feature.

I'll submit another PR and update the docs. ᐧ

Dwight Gunning Twitter me: @dwightgunning https://www.twitter.com/dwightgunning

On 25 November 2015 at 22:25, dynamicdan notifications@github.com wrote:

That's interesting. So you don't actually want to sync any files/fields back to the instance record? That's kind of the main point of FileSync. Are you then building some kind of archive/review system? If so, are you aware of the new --search option? Perhaps you can automate what you want to pull down as record fields to files using search without having the watcher run?

In any case, feel free to submit a new PR to add the .sync_data to the array (inc README update).

— Reply to this email directly or view it on GitHub https://github.com/dynamicdan/filesync/pull/11#issuecomment-159734818.