Paradigm to update the scaffold files created by init
or initialize
: command for init --update
or similar #65
Open
Description
opened on Feb 14, 2023
Two considerations here we'd want to solve for in a generic way if possible:
Decision 1. What logic to use when choosing whether to replace, ignore, or merge changes for files that already exist in their destinations.
Parity with files bundles would simply be the ability to specify an array of files to update. Those files specified would overwrite any existing files.
No smart merge logic exists as of today, but something like copier
is interesting in how it attempts to apply a mergeable diff patch. (Probably more scope that is feasible in a first iteration.)
Decision 2: What to call the command or subcommand used to update the files or project scaffold
A starting proposal would be to add a flag after the init
or initialize
command which is already being used to install the files the first time. I think I like --update
best personally, but I'll list a few ideas / thought experiments below.
# Init projects files (first time)
my-plugin init # installs the extension's files
# Init again with the 'update' flag
my-plugin init --update # updates the extension's files
# Alternatively:
my-plugin init --replace # re-initialize the extension's files
my-plugin init --force # initialize the extension's files (force override)
my-plugin init --interactive # ask for each file that would be overridden
my-plugin init --prompt # ask for each file that would be overridden
Related:
Metadata
Assignees
Labels
No labels
Activity