@embeddables/cli 0.6.10 → 0.6.11
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/commands/branch.js
CHANGED
|
@@ -38,10 +38,10 @@ export async function runBranch(opts) {
|
|
|
38
38
|
console.log('');
|
|
39
39
|
// Pull the selected branch
|
|
40
40
|
if (selectedBranch === null) {
|
|
41
|
-
// User selected "main" - pull
|
|
41
|
+
// User selected "main" - pull main and clear saved branch
|
|
42
42
|
console.log(pc.cyan('Switching to main (latest published version)...'));
|
|
43
43
|
console.log('');
|
|
44
|
-
await runPull({ id: embeddableId });
|
|
44
|
+
await runPull({ id: embeddableId, useMain: true });
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
47
|
console.log(pc.cyan(`Switching to branch: ${selectedBranch.name}...`));
|
package/dist/commands/pull.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type RunPullOptions = {
|
|
|
3
3
|
out?: string;
|
|
4
4
|
branch?: string;
|
|
5
5
|
branchName?: string;
|
|
6
|
+
/** When true, pull main and clear saved branch (e.g. when user explicitly selects "main" in branch switcher). */
|
|
7
|
+
useMain?: boolean;
|
|
6
8
|
fix?: boolean;
|
|
7
9
|
preserve?: boolean;
|
|
8
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAgHA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAgHA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iHAAiH;IACjH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,iBAkQjD"}
|
package/dist/commands/pull.js
CHANGED
|
@@ -153,10 +153,10 @@ export async function runPull(opts) {
|
|
|
153
153
|
embeddableId = selected;
|
|
154
154
|
console.log('');
|
|
155
155
|
}
|
|
156
|
-
//
|
|
157
|
-
const currentFromConfig = opts.branch
|
|
158
|
-
const effectiveBranch = opts.branch ?? currentFromConfig?.branchId;
|
|
159
|
-
const effectiveBranchName = opts.branchName ?? currentFromConfig?.branchName;
|
|
156
|
+
// When useMain, pull main and ignore/clear saved branch. Otherwise stay on current branch when no --branch.
|
|
157
|
+
const currentFromConfig = opts.useMain || opts.branch != null ? null : getCurrentBranchFromConfig(embeddableId);
|
|
158
|
+
const effectiveBranch = opts.useMain ? undefined : (opts.branch ?? currentFromConfig?.branchId);
|
|
159
|
+
const effectiveBranchName = opts.useMain ? undefined : (opts.branchName ?? currentFromConfig?.branchName);
|
|
160
160
|
let url = `https://engine.embeddables.com/${embeddableId}?version=latest`;
|
|
161
161
|
if (effectiveBranch) {
|
|
162
162
|
url += `&embeddable_branch=${effectiveBranch}`;
|