windmill-cli 1.586.2 → 1.586.3

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.
@@ -277,7 +277,15 @@ async function bind(opts, bindWorkspace) {
277
277
  }
278
278
  const { readConfigFile } = await import("../../core/conf.js");
279
279
  const config = await readConfigFile();
280
- const activeWorkspace = await getActiveWorkspace(opts);
280
+ let activeWorkspace = await getActiveWorkspace(opts);
281
+ if (!activeWorkspace && opts.baseUrl && opts.workspace) {
282
+ activeWorkspace = {
283
+ name: opts.workspace,
284
+ remote: opts.baseUrl,
285
+ workspaceId: opts.workspace,
286
+ token: "",
287
+ };
288
+ }
281
289
  if (!activeWorkspace && bindWorkspace) {
282
290
  log.error(colors.red("No active workspace. Use 'wmill workspace add' or 'wmill workspace switch' first"));
283
291
  return;
@@ -6,7 +6,7 @@ import { getHeaders } from "../utils/utils.js";
6
6
  import { getActiveWorkspace, getWorkspaceByName, allWorkspaces, addWorkspace, } from "../commands/workspace/workspace.js";
7
7
  import { getLastUsedProfile, setLastUsedProfile } from "./branch-profiles.js";
8
8
  import { readConfigFile } from "./conf.js";
9
- import { getCurrentGitBranch, getOriginalBranchForWorkspaceForks, getWorkspaceIdForWorkspaceForkFromBranchName, isGitRepository } from "../utils/git.js";
9
+ import { getCurrentGitBranch, getOriginalBranchForWorkspaceForks, getWorkspaceIdForWorkspaceForkFromBranchName, isGitRepository, } from "../utils/git.js";
10
10
  import { WM_FORK_PREFIX } from "../main.js";
11
11
  // Helper function to select from multiple matching profiles
12
12
  async function selectFromMultipleProfiles(profiles, baseUrl, workspaceId, context, configDir) {
@@ -16,7 +16,7 @@ async function selectFromMultipleProfiles(profiles, baseUrl, workspaceId, contex
16
16
  // Check for last used profile
17
17
  const lastUsedProfileName = await getLastUsedProfile("", baseUrl, workspaceId, configDir);
18
18
  if (lastUsedProfileName) {
19
- const lastUsedProfile = profiles.find(p => p.name === lastUsedProfileName);
19
+ const lastUsedProfile = profiles.find((p) => p.name === lastUsedProfileName);
20
20
  if (lastUsedProfile) {
21
21
  log.info(colors.green(`Using last used profile '${lastUsedProfile.name}' for ${context}`));
22
22
  return lastUsedProfile;
@@ -34,12 +34,12 @@ async function selectFromMultipleProfiles(profiles, baseUrl, workspaceId, contex
34
34
  log.info(colors.yellow(`\nMultiple workspace profiles found for ${context}:`));
35
35
  const selectedName = await Select.prompt({
36
36
  message: "Select profile",
37
- options: profiles.map(p => ({
37
+ options: profiles.map((p) => ({
38
38
  name: `${p.name} (${p.workspaceId} on ${p.remote})`,
39
39
  value: p.name,
40
40
  })),
41
41
  });
42
- const selectedProfile = profiles.find(p => p.name === selectedName);
42
+ const selectedProfile = profiles.find((p) => p.name === selectedName);
43
43
  // Save selection for next time
44
44
  await setLastUsedProfile("", // No branch context for general workspace selection
45
45
  baseUrl, workspaceId, selectedProfile.name, configDir);
@@ -141,7 +141,7 @@ export async function tryResolveBranchWorkspace(opts) {
141
141
  return undefined;
142
142
  }
143
143
  log.info(`Using branch configuration for branch \`${currentBranch}\` set in gitBranches`);
144
- let { baseUrl, workspaceId } = branchConfig;
144
+ const { baseUrl, workspaceId } = branchConfig;
145
145
  let normalizedBaseUrl;
146
146
  try {
147
147
  normalizedBaseUrl = new URL(baseUrl).toString();
@@ -152,7 +152,7 @@ export async function tryResolveBranchWorkspace(opts) {
152
152
  }
153
153
  // Find all profiles matching this baseUrl and workspaceId
154
154
  const allProfiles = await allWorkspaces(opts.configDir);
155
- const matchingProfiles = allProfiles.filter(w => w.remote === normalizedBaseUrl && w.workspaceId === workspaceId);
155
+ const matchingProfiles = allProfiles.filter((w) => w.remote === normalizedBaseUrl && w.workspaceId === workspaceId);
156
156
  if (matchingProfiles.length === 0) {
157
157
  // No matching profile exists - prompt to create one
158
158
  return await createWorkspaceProfileInteractively(normalizedBaseUrl, workspaceId, currentBranch, opts, { rawBranch, isForked: !!originalBranchIfForked });
@@ -167,7 +167,7 @@ export async function tryResolveBranchWorkspace(opts) {
167
167
  // For multiple profiles, check branch-specific last used first
168
168
  const lastUsedName = await getLastUsedProfile(currentBranch, normalizedBaseUrl, workspaceId, opts.configDir);
169
169
  if (lastUsedName) {
170
- const lastUsedProfile = matchingProfiles.find(p => p.name === lastUsedName);
170
+ const lastUsedProfile = matchingProfiles.find((p) => p.name === lastUsedName);
171
171
  if (lastUsedProfile) {
172
172
  log.info(colors.green(`Using workspace profile '${lastUsedProfile.name}' for branch '${currentBranch}' (last used)`));
173
173
  return lastUsedProfile;
@@ -208,7 +208,7 @@ export async function resolveWorkspace(opts) {
208
208
  if (!existingWorkspace) {
209
209
  const { allWorkspaces } = await import("../commands/workspace/workspace.js");
210
210
  const workspaces = await allWorkspaces(opts.configDir);
211
- const matchingWorkspaces = workspaces.filter(w => w.workspaceId === opts.workspace && w.remote === normalizedBaseUrl);
211
+ const matchingWorkspaces = workspaces.filter((w) => w.workspaceId === opts.workspace && w.remote === normalizedBaseUrl);
212
212
  if (matchingWorkspaces.length >= 1) {
213
213
  existingWorkspace = await selectFromMultipleProfiles(matchingWorkspaces, normalizedBaseUrl, opts.workspace, `workspace "${opts.workspace}" on ${normalizedBaseUrl}`, opts.configDir);
214
214
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.586.2",
3
+ "version": "1.586.3",
4
4
  "description": "CLI for Windmill",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../../src/src/commands/workspace/workspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM/C,OAAO,EAEL,OAAO,EAMR,MAAM,kBAAkB,CAAC;AAM1B,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB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