superzanti / ServerSync

Sync files between client and server for Minecraft Forge
GNU General Public License v3.0
157 stars 26 forks source link

Support for parsing .gitignore-like lists for include & ignore #218

Open vico93 opened 3 years ago

vico93 commented 3 years ago

Currently i'm using a private git server (in a gitbucket instance on my RPI3b+) to send my Fabric modpack to my friend.

Since i play with only one person (and the dedicated server) i think keeping a whole git server running is a bit overkill for it (and i use that only to host my modpack), that's why i'm interesting in moving back to ServerSync (used it back when i was using 1.8 and Forge).

But i became kinda addicted to the gitignore standard, and i want to ask if would be possible to make serversync able to parse .gitignore (or a plain-text file with other name but in the same internal format) files in same level of ServerSync .jar/.exe instead of need to rely entirely on config options (i read the wiki and think its kinda confusing because it separate files and directories list, while on .gitignore files you can declare them together).

Thanks in advance!

rheimus commented 3 years ago

.gitignore uses glob patterns, which is similar to how SS config works.

I intend to separate directory management and file inclusion in the next version so that it will be more like:

directories: [
  {path: 'mods', mode: 'mirror'}
],
files: {
  include: [
    **/bobs_stuff/**,
    mods/carrots.jar
  ],
  ignore: [
    **/*.ignore,
    mods/nuts.wad
  ]
}

For the immediate future I will not be maintaining multiple configuration styles, however, a .serversyncignore would be nice to add later.