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

Redirecting ignores subfolders structure #318

Open
SMN47 opened this issue May 25, 2024 · 2 comments
Open

Redirecting ignores subfolders structure #318

SMN47 opened this issue May 25, 2024 · 2 comments

Comments

@SMN47
Copy link

SMN47 commented May 25, 2024

Serversync Version: 4.3.0 CLI

Minecraft Version: Fabric 1.20.1

Issue:

I want to sync /config and /mods folders directly, but redirect contents of /saves folder to newly created folder /saves_SMN47, everything in mirror mode.

The code Is use is:

"rules": {
    "directories": [
      {
        "path": "mods",
        "mode": "mirror"
      },
      {
        "path": "config",
        "mode": "mirror"
      },
      {
        "path": "saves",
        "mode": "mirror"
      }
    ],
    "files": {
      "include": [
        "mods/**",
	"config/**",
	"saves/**",
	"options.amecsapi.txt",
	"options.txt"
      ],
      "ignore": [
        "**/serversync-*.jar",
        "**/serversync-*.cfg"
      ],
      "redirect": [
	   { "pattern": "saves/**", "redirectTo": "saves_SMN47" }
        
      ]
    }

Folders that synced directly keeps all the subfolders and teir contents just fine. Redirected folder on client side ignore all subfolders structure.

Expected result:

изображение

Current result:

изображение

@rheimus
Copy link
Collaborator

rheimus commented Jan 22, 2025

could introduce a flat config option to redirects that specifies what type of directory structure is used.

{ 
  "redirect": [
    { "pattern": "test/**", "redirectTo": "somewhere", "flat": false }
  ]
} 

Defaulting this to true would preserve existing behavior.

@rheimus
Copy link
Collaborator

rheimus commented Jan 22, 2025

Relates to #307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants