@biffo/cli 0.224.0 → 0.224.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3083,9 +3083,20 @@ function describeFailures(outcomes) {
|
|
|
3083
3083
|
|
|
3084
3084
|
// src/commands/core-upgrade.ts
|
|
3085
3085
|
var MISSING_TEMPLATE_ROOT_GUIDANCE2 = "Pass --template-repo <path> to a biffo-template git checkout, e.g. `biffo core upgrade --template-repo /path/to/biffo-template`.";
|
|
3086
|
+
function resolveTemplateRepoFlag(templateRepo, template) {
|
|
3087
|
+
if (templateRepo !== void 0 && template !== void 0 && resolve3(templateRepo) !== resolve3(template)) {
|
|
3088
|
+
throw new Error(
|
|
3089
|
+
`Both --template-repo (${templateRepo}) and --template (${template}) were given, with different paths. They are the same argument \u2014 --template is an alias for --template-repo (#1138) \u2014 so pass only one.`
|
|
3090
|
+
);
|
|
3091
|
+
}
|
|
3092
|
+
return templateRepo ?? template;
|
|
3093
|
+
}
|
|
3086
3094
|
var coreUpgradeCommand = new Command3("upgrade").description("Three-way-merge template-owned files for a core upgrade; preview it or open a PR").option("--cwd <path>", "Instance repo root to upgrade (defaults to the current directory)").option(
|
|
3087
3095
|
"--template-repo <path>",
|
|
3088
3096
|
"Path to a biffo-template git checkout whose core-v* tags supply the base/target trees (defaults to the template this CLI ships with)"
|
|
3097
|
+
).option(
|
|
3098
|
+
"--template <path>",
|
|
3099
|
+
"Alias for --template-repo, so the flag that works on `core diff` also works here (#1138). Errors if both are given with different paths."
|
|
3089
3100
|
).option("--to <version>", "Target core version (defaults to the template\u2019s latest core.version)").option(
|
|
3090
3101
|
"--from-template <path>",
|
|
3091
3102
|
"Override: path to a template checkout at the instance\u2019s CURRENT version (the merge base). Normally auto-resolved from the core-v<version> tag."
|
|
@@ -3103,22 +3114,23 @@ var coreUpgradeCommand = new Command3("upgrade").description("Three-way-merge te
|
|
|
3103
3114
|
"Delete local branches previous upgrade runs left behind, once their PR has merged (#758)"
|
|
3104
3115
|
).action(
|
|
3105
3116
|
async (options) => {
|
|
3106
|
-
const cwd = options.cwd ? resolve3(options.cwd) : process.cwd();
|
|
3107
|
-
const runOptions = {
|
|
3108
|
-
cwd,
|
|
3109
|
-
apply: options.apply ?? false,
|
|
3110
|
-
allowConflicts: options.allowConflicts ?? false,
|
|
3111
|
-
acknowledgeBreaking: options.acknowledgeBreaking ?? false,
|
|
3112
|
-
allowDirty: options.allowDirty ?? false
|
|
3113
|
-
};
|
|
3114
|
-
if (options.templateRepo) runOptions.templateRepo = resolve3(options.templateRepo);
|
|
3115
|
-
if (options.to) runOptions.toVersion = options.to;
|
|
3116
|
-
if (options.fromTemplate) runOptions.baseDir = resolve3(options.fromTemplate);
|
|
3117
|
-
if (options.toTemplate) runOptions.theirsDir = resolve3(options.toTemplate);
|
|
3118
|
-
if (options.base) runOptions.base = options.base;
|
|
3119
|
-
if (options.remote) runOptions.remote = options.remote;
|
|
3120
|
-
if (options.reap) runOptions.reap = true;
|
|
3121
3117
|
try {
|
|
3118
|
+
const cwd = options.cwd ? resolve3(options.cwd) : process.cwd();
|
|
3119
|
+
const runOptions = {
|
|
3120
|
+
cwd,
|
|
3121
|
+
apply: options.apply ?? false,
|
|
3122
|
+
allowConflicts: options.allowConflicts ?? false,
|
|
3123
|
+
acknowledgeBreaking: options.acknowledgeBreaking ?? false,
|
|
3124
|
+
allowDirty: options.allowDirty ?? false
|
|
3125
|
+
};
|
|
3126
|
+
const templateRepoFlag = resolveTemplateRepoFlag(options.templateRepo, options.template);
|
|
3127
|
+
if (templateRepoFlag) runOptions.templateRepo = resolve3(templateRepoFlag);
|
|
3128
|
+
if (options.to) runOptions.toVersion = options.to;
|
|
3129
|
+
if (options.fromTemplate) runOptions.baseDir = resolve3(options.fromTemplate);
|
|
3130
|
+
if (options.toTemplate) runOptions.theirsDir = resolve3(options.toTemplate);
|
|
3131
|
+
if (options.base) runOptions.base = options.base;
|
|
3132
|
+
if (options.remote) runOptions.remote = options.remote;
|
|
3133
|
+
if (options.reap) runOptions.reap = true;
|
|
3122
3134
|
await runCoreUpgrade(runOptions);
|
|
3123
3135
|
} catch (err) {
|
|
3124
3136
|
log.error(err.message);
|