Skip to content

Enhance APPLY_EXTRA_FILES to support archive files as source #4147

Description

@itzg

Proposing introducing a couple of syntax enhancements to indicate the new behavior

  • dst<<src means extract from src to dst
  • dst<<src@path means extract the subdirectory path of src archive to dst

Discussed in Discord

┌──────────────────────────────────────────────────────────────────────────────────────┐
│  world1<</worlds/world1.zip                                                          │
│        ▲▲                                                                            │
│        │└─────────────────────────────── extract from source                         │
│        │                                                                             │
│        └──────────────────────── copy into specific destination                      │
│                                                                                      │
│                                         world1.zip                                   │
│   /data/                                ┌──────────────────────────────────────┐     │
│   ├── world1/ ◄─────────────────────────┼─ ./                                  │     │
│   │   ├── advancements/                 │  ├── advancements/                   │     │
│   │   ├── datapacks/                    │  ├── datapacks/                      │     │
│   │   ├── dim-1/                        │  ├── dim-1/                          │     │
│   │   ├── dim1/                         │  ├── dim1/                           │     │
│   │   ├── entities/                     │  ├── entities/                       │     │
│   │   ├── playerdata/                   │  ├── playerdata/                     │     │
│   │   ├── poi/                          │  ├── poi/                            │     │
│   │   ├── region/                       │  ├── region/                         │     │
│   │   ├── level.dat                     │  ├── level.dat                       │     │
│   │   └── level.dat_old                 │  └── level.dat_old                   │     │
│   └── world2/                           └──────────────────────────────────────┘     │
│       ├── level.dat                                                                  │
│       ├── level.dat_old                                                              │
│       └── ...                                                                        │
└──────────────────────────────────────────────────────────────────────────────────────┘
                                                                                        
┌──────────────────────────────────────────────────────────────────────────────────────┐
│                            ┌────────── "path within archive"                         │
│                            ▼                                                         │
│  world1<</worlds/world1.zip@world1                                                   │
│        ▲▲                                                                            │
│        │└─────────────────────────────── extract from source                         │
│        │                                                                             │
│        └──────────────────────── copy into specific destination                      │
│                                                                                      │
│  /data/                                world1.zip                                    │
│  ├── world1/ ◄──────────────┐          ┌──────────────────────────────────────┐      │
│  │   ├── advancements/      └──────────┼─ world1/                             │      │
│  │   ├── datapacks/                    │  ├── advancements/                   │      │
│  │   ├── dim-1/                        │  ├── datapacks/                      │      │
│  │   ├── dim1/                         │  ├── dim-1/                          │      │
│  │   ├── entities/                     │  ├── dim1/                           │      │
│  │   ├── playerdata/                   │  ├── entities/                       │      │
│  │   ├── poi/                          │  ├── playerdata/                     │      │
│  │   ├── region/                       │  ├── poi/                            │      │
│  │   ├── level.dat                     │  ├── region/                         │      │
│  │   └── level.dat_old                 │  ├── level.dat                       │      │
│  └── world2/                           │  └── level.dat_old                   │      │
│      ├── level.dat                     └──────────────────────────────────────┘      │
│      ├── level.dat_old                                                               │
│      └── ...                                                                         │
└──────────────────────────────────────────────────────────────────────────────────────┘

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions