@beyondwork/wb-cli 0.1.9 → 0.1.10
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/out/cli.js +168 -89
- package/out/lib/logger.js +1 -1
- package/out/lib/logger.js.map +1 -1
- package/package.json +1 -1
package/out/cli.js
CHANGED
|
@@ -44,7 +44,7 @@ const logger = new lib_1.ConsoleLogger();
|
|
|
44
44
|
// Helper function for submitting workblocks
|
|
45
45
|
async function performSubmitWorkblock(workblockPathIdentifier, // Path used for logging, can be relative or absolute
|
|
46
46
|
publishUrl, basePathForResolution, // The path from which workblockPathIdentifier is resolved if relative
|
|
47
|
-
loggerToUse) {
|
|
47
|
+
loggerToUse, customHeaders = {}) {
|
|
48
48
|
const absoluteWorkblockPath = path.resolve(basePathForResolution, workblockPathIdentifier);
|
|
49
49
|
loggerToUse.log(`Attempting to assemble workblock from: ${absoluteWorkblockPath} (identifier: ${workblockPathIdentifier})`);
|
|
50
50
|
if (!fs.existsSync(absoluteWorkblockPath)) {
|
|
@@ -58,11 +58,13 @@ loggerToUse) {
|
|
|
58
58
|
}
|
|
59
59
|
const output = JSON.stringify(workblock, null, 2);
|
|
60
60
|
loggerToUse.log(`Submitting workblock from ${workblockPathIdentifier} to ${publishUrl}...`);
|
|
61
|
+
const headers = {
|
|
62
|
+
"Content-Type": "application/json",
|
|
63
|
+
...customHeaders,
|
|
64
|
+
};
|
|
61
65
|
const response = await fetch(publishUrl, {
|
|
62
|
-
method:
|
|
63
|
-
headers
|
|
64
|
-
'Content-Type': 'application/json',
|
|
65
|
-
},
|
|
66
|
+
method: "POST",
|
|
67
|
+
headers,
|
|
66
68
|
body: output,
|
|
67
69
|
});
|
|
68
70
|
if (response.ok) {
|
|
@@ -81,15 +83,76 @@ loggerToUse) {
|
|
|
81
83
|
throw new Error(`Failed to submit workblock from ${workblockPathIdentifier}. Status: ${response.status}`);
|
|
82
84
|
}
|
|
83
85
|
}
|
|
86
|
+
// Helper function for finding changed workblock directories
|
|
87
|
+
async function findChangedWorkblocks(workblockBaseDir, workspace, gitDiffBase, gitDiffHead, loggerToUse) {
|
|
88
|
+
const workspaceAbsPath = path.resolve(workspace);
|
|
89
|
+
loggerToUse.log("Determining changed workblock directories...");
|
|
90
|
+
loggerToUse.log(`Workspace: ${workspaceAbsPath}`);
|
|
91
|
+
loggerToUse.log(`Workblock Base Directory (relative to workspace): ${workblockBaseDir}`);
|
|
92
|
+
let diffOutput = "";
|
|
93
|
+
try {
|
|
94
|
+
const diffCommand = `git diff --name-only "${gitDiffBase}" "${gitDiffHead}"`;
|
|
95
|
+
loggerToUse.log(`Running git diff: ${diffCommand} in ${workspaceAbsPath}`);
|
|
96
|
+
diffOutput = (0, child_process_1.execSync)(diffCommand, {
|
|
97
|
+
cwd: workspaceAbsPath,
|
|
98
|
+
encoding: "utf8",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
const errorDetails = e instanceof Error ? e.message : String(e);
|
|
103
|
+
loggerToUse.error(`Failed to run git diff: ${errorDetails}`);
|
|
104
|
+
if (e && typeof e === "object" && "stderr" in e && e.stderr) {
|
|
105
|
+
loggerToUse.error(`Git stderr: ${String(e.stderr)}`);
|
|
106
|
+
}
|
|
107
|
+
throw new Error(`Failed to run git diff: ${errorDetails}`);
|
|
108
|
+
}
|
|
109
|
+
const allChangedFiles = diffOutput.split("\n").filter((f) => f.trim() !== "");
|
|
110
|
+
loggerToUse.log(`All changed files (${allChangedFiles.length}): ${allChangedFiles.join(", ") || "None"}`);
|
|
111
|
+
if (allChangedFiles.length === 0) {
|
|
112
|
+
loggerToUse.log("No files changed according to git diff.");
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
const manifestPattern = path.join(workblockBaseDir, "**/{manifest.yaml,*manifest.yaml}");
|
|
116
|
+
loggerToUse.log(`Searching for manifest files with pattern: ${manifestPattern} (relative to ${workspaceAbsPath})`);
|
|
117
|
+
// globSync expects patterns relative to its CWD option, or absolute paths.
|
|
118
|
+
const manifestFiles = (0, glob_1.sync)(manifestPattern, {
|
|
119
|
+
cwd: workspaceAbsPath,
|
|
120
|
+
nodir: true,
|
|
121
|
+
absolute: true,
|
|
122
|
+
});
|
|
123
|
+
loggerToUse.log(`Found manifest files (${manifestFiles.length}): ${manifestFiles.join(", ") || "None"}`);
|
|
124
|
+
if (manifestFiles.length === 0) {
|
|
125
|
+
loggerToUse.log("No manifest files found.");
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
const dirsToProcess = new Set();
|
|
129
|
+
for (const manifestFileAbs of manifestFiles) {
|
|
130
|
+
const workblockRootDirAbs = path.dirname(manifestFileAbs);
|
|
131
|
+
loggerToUse.log(`Potential workblock root (absolute): ${workblockRootDirAbs}`);
|
|
132
|
+
for (const changedFileRelative of allChangedFiles) {
|
|
133
|
+
const fullChangedFilePathAbs = path.resolve(workspaceAbsPath, changedFileRelative);
|
|
134
|
+
if (fullChangedFilePathAbs.startsWith(workblockRootDirAbs + path.sep) ||
|
|
135
|
+
fullChangedFilePathAbs === workblockRootDirAbs) {
|
|
136
|
+
const relativeWorkblockPath = path.relative(workspaceAbsPath, workblockRootDirAbs);
|
|
137
|
+
dirsToProcess.add(relativeWorkblockPath);
|
|
138
|
+
loggerToUse.log(`Found changed file '${changedFileRelative}' in workblock '${relativeWorkblockPath}'. Adding to process list.`);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const result = Array.from(dirsToProcess);
|
|
144
|
+
loggerToUse.log(`Found ${result.length} changed workblock directories: ${result.join(", ") || "None"}`);
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
84
147
|
// Define CLI
|
|
85
148
|
commander_1.program
|
|
86
|
-
.name(
|
|
87
|
-
.description(
|
|
88
|
-
.version(process.env.npm_package_version ||
|
|
149
|
+
.name("wb-cli") // Updated name
|
|
150
|
+
.description("CLI for working with Beyond Work workblocks")
|
|
151
|
+
.version(process.env.npm_package_version || "0.0.0");
|
|
89
152
|
commander_1.program
|
|
90
|
-
.command(
|
|
91
|
-
.description(
|
|
92
|
-
.option(
|
|
153
|
+
.command("assemble <directory>")
|
|
154
|
+
.description("Assemble a workblock from a directory")
|
|
155
|
+
.option("-o, --output <file>", "Output file (defaults to stdout)")
|
|
93
156
|
.action(async (directory, options) => {
|
|
94
157
|
try {
|
|
95
158
|
const dirPath = path.resolve(directory); // Resolves from CWD
|
|
@@ -99,7 +162,7 @@ commander_1.program
|
|
|
99
162
|
}
|
|
100
163
|
const workblock = await (0, lib_1.assembleWorkblock)(dirPath, logger);
|
|
101
164
|
if (!workblock) {
|
|
102
|
-
logger.error(
|
|
165
|
+
logger.error("Failed to assemble workblock");
|
|
103
166
|
process.exit(1);
|
|
104
167
|
}
|
|
105
168
|
const output = JSON.stringify(workblock, null, 2);
|
|
@@ -119,14 +182,35 @@ commander_1.program
|
|
|
119
182
|
}
|
|
120
183
|
});
|
|
121
184
|
commander_1.program
|
|
122
|
-
.command(
|
|
123
|
-
.description(
|
|
124
|
-
.option(
|
|
185
|
+
.command("submit <directory> <url>")
|
|
186
|
+
.description("Assemble a workblock and POST it to a URL")
|
|
187
|
+
.option("-w, --workspace <path>", "Workspace path, if directory is relative to it", ".")
|
|
188
|
+
.option("-H, --header <header>", "Add custom header in format 'Header-Name: value' (can be used multiple times)", (value, previous = []) => {
|
|
189
|
+
const headers = previous;
|
|
190
|
+
headers.push(value);
|
|
191
|
+
return headers;
|
|
192
|
+
}, [])
|
|
125
193
|
.action(async (directory, url, options) => {
|
|
126
194
|
try {
|
|
195
|
+
// Parse headers from array of strings into object
|
|
196
|
+
const customHeaders = {};
|
|
197
|
+
for (const headerString of options.header) {
|
|
198
|
+
const colonIndex = headerString.indexOf(":");
|
|
199
|
+
if (colonIndex === -1) {
|
|
200
|
+
logger.error(`Invalid header format: ${headerString}. Expected 'Header-Name: value'`);
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
const headerName = headerString.substring(0, colonIndex).trim();
|
|
204
|
+
const headerValue = headerString.substring(colonIndex + 1).trim();
|
|
205
|
+
if (!headerName) {
|
|
206
|
+
logger.error(`Invalid header format: ${headerString}. Header name cannot be empty`);
|
|
207
|
+
process.exit(1);
|
|
208
|
+
}
|
|
209
|
+
customHeaders[headerName] = headerValue;
|
|
210
|
+
}
|
|
127
211
|
// 'directory' is user input. 'options.workspace' is CWD by default.
|
|
128
212
|
// performSubmitWorkblock resolves 'directory' relative to 'options.workspace'.
|
|
129
|
-
await performSubmitWorkblock(directory, url, options.workspace, logger);
|
|
213
|
+
await performSubmitWorkblock(directory, url, options.workspace, logger, customHeaders);
|
|
130
214
|
}
|
|
131
215
|
catch (error) {
|
|
132
216
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -136,14 +220,14 @@ commander_1.program
|
|
|
136
220
|
});
|
|
137
221
|
// New command: publish-changed-workblocks
|
|
138
222
|
commander_1.program
|
|
139
|
-
.command(
|
|
140
|
-
.description(
|
|
141
|
-
.requiredOption(
|
|
142
|
-
.requiredOption(
|
|
143
|
-
.option(
|
|
144
|
-
.option(
|
|
145
|
-
.option(
|
|
146
|
-
.option(
|
|
223
|
+
.command("publish-changed-workblocks")
|
|
224
|
+
.description("Detects changed workblocks based on git diff and submits them. Optionally comments on a PR.")
|
|
225
|
+
.requiredOption("-u, --publish-url <url>", "URL to publish/submit the workblocks to")
|
|
226
|
+
.requiredOption("-b, --workblock-base-dir <dir>", "Base directory within the workspace where workblocks are located")
|
|
227
|
+
.option("-w, --workspace <path>", "Path to the git workspace root", ".")
|
|
228
|
+
.option("-t, --github-token <token>", "GitHub token for PR commenting and API interactions")
|
|
229
|
+
.option("--git-diff-base <ref>", "Base ref for git diff (e.g., HEAD^, origin/main)", "HEAD^")
|
|
230
|
+
.option("--git-diff-head <ref>", "Head ref for git diff", "HEAD")
|
|
147
231
|
.action(async (options) => {
|
|
148
232
|
const { publishUrl, workblockBaseDir, workspace, githubToken, gitDiffBase, gitDiffHead, } = options;
|
|
149
233
|
// Dynamically import Octokit
|
|
@@ -152,72 +236,35 @@ commander_1.program
|
|
|
152
236
|
if (githubToken) {
|
|
153
237
|
octokitInstance = new Octokit({ auth: githubToken });
|
|
154
238
|
}
|
|
155
|
-
const
|
|
156
|
-
logger.log('Determining changed workblock directories...');
|
|
157
|
-
logger.log(`Workspace: ${workspaceAbsPath}`);
|
|
158
|
-
logger.log(`Workblock Base Directory (relative to workspace): ${workblockBaseDir}`);
|
|
159
|
-
let diffOutput = '';
|
|
160
|
-
try {
|
|
161
|
-
const diffCommand = `git diff --name-only "${gitDiffBase}" "${gitDiffHead}"`;
|
|
162
|
-
logger.log(`Running git diff: ${diffCommand} in ${workspaceAbsPath}`);
|
|
163
|
-
diffOutput = (0, child_process_1.execSync)(diffCommand, { cwd: workspaceAbsPath, encoding: 'utf8' });
|
|
164
|
-
}
|
|
165
|
-
catch (e) {
|
|
166
|
-
const errorDetails = e instanceof Error ? e.message : String(e);
|
|
167
|
-
logger.error(`Failed to run git diff: ${errorDetails}`);
|
|
168
|
-
if (e && typeof e === 'object' && 'stderr' in e && e.stderr) {
|
|
169
|
-
logger.error(`Git stderr: ${String(e.stderr)}`);
|
|
170
|
-
}
|
|
171
|
-
process.exit(1);
|
|
172
|
-
}
|
|
173
|
-
const allChangedFiles = diffOutput.split('\n').filter(f => f.trim() !== '');
|
|
174
|
-
logger.log(`All changed files (${allChangedFiles.length}): ${allChangedFiles.join(', ') || 'None'}`);
|
|
175
|
-
if (allChangedFiles.length === 0) {
|
|
176
|
-
logger.log('No files changed according to git diff. Exiting.');
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
const manifestPattern = path.join(workblockBaseDir, '**/{manifest.yaml,*manifest.yaml}');
|
|
180
|
-
logger.log(`Searching for manifest files with pattern: ${manifestPattern} (relative to ${workspaceAbsPath})`);
|
|
181
|
-
// globSync expects patterns relative to its CWD option, or absolute paths.
|
|
182
|
-
const manifestFiles = (0, glob_1.sync)(manifestPattern, { cwd: workspaceAbsPath, nodir: true, absolute: true });
|
|
183
|
-
logger.log(`Found manifest files (${manifestFiles.length}): ${manifestFiles.join(', ') || 'None'}`);
|
|
184
|
-
if (manifestFiles.length === 0) {
|
|
185
|
-
logger.log('No manifest files found. Exiting.');
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
const dirsToProcess = new Set();
|
|
189
|
-
for (const manifestFileAbs of manifestFiles) {
|
|
190
|
-
const workblockRootDirAbs = path.dirname(manifestFileAbs);
|
|
191
|
-
logger.log(`Potential workblock root (absolute): ${workblockRootDirAbs}`);
|
|
192
|
-
for (const changedFileRelative of allChangedFiles) {
|
|
193
|
-
const fullChangedFilePathAbs = path.resolve(workspaceAbsPath, changedFileRelative);
|
|
194
|
-
if (fullChangedFilePathAbs.startsWith(workblockRootDirAbs + path.sep) || fullChangedFilePathAbs === workblockRootDirAbs) {
|
|
195
|
-
const relativeWorkblockPath = path.relative(workspaceAbsPath, workblockRootDirAbs);
|
|
196
|
-
dirsToProcess.add(relativeWorkblockPath);
|
|
197
|
-
logger.log(`Found changed file '${changedFileRelative}' in workblock '${relativeWorkblockPath}'. Adding to process list.`);
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
239
|
+
const changedWorkblocks = await findChangedWorkblocks(workblockBaseDir, workspace, gitDiffBase, gitDiffHead, logger);
|
|
202
240
|
// New: Determine PR info if githubToken is provided
|
|
203
241
|
let prNumberForComment;
|
|
204
242
|
let prRepoOwner;
|
|
205
243
|
let prRepoName;
|
|
206
|
-
if (octokitInstance) {
|
|
207
|
-
|
|
244
|
+
if (octokitInstance) {
|
|
245
|
+
// This implies githubToken is present
|
|
246
|
+
logger.log("Attempting to determine PR information from the current commit...");
|
|
208
247
|
try {
|
|
209
|
-
const commitSha = (0, child_process_1.execSync)(
|
|
248
|
+
const commitSha = (0, child_process_1.execSync)("git rev-parse HEAD", {
|
|
249
|
+
cwd: workspace,
|
|
250
|
+
encoding: "utf8",
|
|
251
|
+
}).trim();
|
|
210
252
|
logger.log(`Current commit SHA: ${commitSha}`);
|
|
211
|
-
const remoteUrl = (0, child_process_1.execSync)(
|
|
253
|
+
const remoteUrl = (0, child_process_1.execSync)("git remote get-url origin", {
|
|
254
|
+
cwd: workspace,
|
|
255
|
+
encoding: "utf8",
|
|
256
|
+
}).trim();
|
|
212
257
|
logger.log(`Git remote origin URL: ${remoteUrl}`);
|
|
213
258
|
// Regex to capture owner and repo from https or git@github.com URLs
|
|
214
|
-
const parts = remoteUrl.split(
|
|
259
|
+
const parts = remoteUrl.split("/");
|
|
215
260
|
if (parts.length < 2) {
|
|
216
261
|
logger.log(`Could not parse owner/repo from git remote URL: '${remoteUrl}'. Skipping PR interaction.`);
|
|
217
262
|
return;
|
|
218
263
|
}
|
|
219
264
|
const repoNameWithGit = parts[parts.length - 1];
|
|
220
|
-
prRepoName = repoNameWithGit.endsWith(
|
|
265
|
+
prRepoName = repoNameWithGit.endsWith(".git")
|
|
266
|
+
? repoNameWithGit.slice(0, -4)
|
|
267
|
+
: repoNameWithGit;
|
|
221
268
|
prRepoOwner = parts[parts.length - 2];
|
|
222
269
|
logger.log(`Inferred repository: ${prRepoOwner}/${prRepoName}`);
|
|
223
270
|
const { data: prsAssociatedWithCommit } = await octokitInstance.rest.repos.listPullRequestsAssociatedWithCommit({
|
|
@@ -226,7 +273,7 @@ commander_1.program
|
|
|
226
273
|
commit_sha: commitSha,
|
|
227
274
|
});
|
|
228
275
|
if (prsAssociatedWithCommit.length > 0) {
|
|
229
|
-
const openPr = prsAssociatedWithCommit.find(pr => pr.state ===
|
|
276
|
+
const openPr = prsAssociatedWithCommit.find((pr) => pr.state === "open");
|
|
230
277
|
const selectedPr = openPr || prsAssociatedWithCommit[0]; // Prefer open PR, fallback to the first one
|
|
231
278
|
prNumberForComment = selectedPr.number;
|
|
232
279
|
logger.log(`Found PR #${prNumberForComment} (state: ${selectedPr.state}) associated with commit ${commitSha} in ${prRepoOwner}/${prRepoName}.`);
|
|
@@ -240,16 +287,17 @@ commander_1.program
|
|
|
240
287
|
logger.error(`Error determining PR information: ${errorMsg}. Skipping PR interaction.`);
|
|
241
288
|
}
|
|
242
289
|
}
|
|
243
|
-
if (
|
|
244
|
-
logger.log(
|
|
290
|
+
if (changedWorkblocks.length === 0) {
|
|
291
|
+
logger.log("No changed workblock directories (containing a manifest and changes) found.");
|
|
245
292
|
return;
|
|
246
293
|
}
|
|
247
|
-
logger.log(`Found ${
|
|
294
|
+
logger.log(`Found ${changedWorkblocks.length} changed workblock directories to process: ${changedWorkblocks.join(", ")}`);
|
|
248
295
|
let anySubmissionFailed = false;
|
|
249
|
-
for (const dirRelToWorkspace of
|
|
296
|
+
for (const dirRelToWorkspace of changedWorkblocks) {
|
|
250
297
|
logger.log(`Processing directory: ${dirRelToWorkspace}`);
|
|
251
298
|
try {
|
|
252
|
-
await performSubmitWorkblock(dirRelToWorkspace, publishUrl,
|
|
299
|
+
await performSubmitWorkblock(dirRelToWorkspace, publishUrl, workspace, logger, {} // No custom headers for bulk publish
|
|
300
|
+
);
|
|
253
301
|
logger.log(`Successfully submitted workblock for directory: ${dirRelToWorkspace}`);
|
|
254
302
|
}
|
|
255
303
|
catch (error) {
|
|
@@ -258,14 +306,20 @@ commander_1.program
|
|
|
258
306
|
anySubmissionFailed = true;
|
|
259
307
|
}
|
|
260
308
|
}
|
|
261
|
-
if (prNumberForComment &&
|
|
309
|
+
if (prNumberForComment &&
|
|
310
|
+
prRepoOwner &&
|
|
311
|
+
prRepoName &&
|
|
312
|
+
octokitInstance &&
|
|
313
|
+
changedWorkblocks.length > 0) {
|
|
314
|
+
// New condition
|
|
262
315
|
logger.log(`Attempting to comment on PR #${prNumberForComment} in repo ${prRepoOwner}/${prRepoName}`);
|
|
263
|
-
let commentBody =
|
|
264
|
-
for (const dir of
|
|
316
|
+
let commentBody = "The following workblock directories were processed by `wb-cli publish-changed-workblocks`:\n";
|
|
317
|
+
for (const dir of changedWorkblocks) {
|
|
265
318
|
commentBody += `- \`\`\`${dir}\`\`\`\n`; // Using backticks for dirs
|
|
266
319
|
}
|
|
267
320
|
if (anySubmissionFailed) {
|
|
268
|
-
commentBody +=
|
|
321
|
+
commentBody +=
|
|
322
|
+
"\nNote: One or more submissions failed. Check logs for details.";
|
|
269
323
|
}
|
|
270
324
|
try {
|
|
271
325
|
await octokitInstance.rest.issues.createComment({
|
|
@@ -282,8 +336,9 @@ commander_1.program
|
|
|
282
336
|
anySubmissionFailed = true;
|
|
283
337
|
}
|
|
284
338
|
}
|
|
285
|
-
else if (
|
|
286
|
-
|
|
339
|
+
else if (changedWorkblocks.length > 0 && githubToken) {
|
|
340
|
+
// Modified condition to check githubToken directly
|
|
341
|
+
logger.log("Workblock directories were processed. PR commenting skipped: Could not automatically determine PR information, no relevant PR found for the current commit, or GitHub token was missing/invalid.");
|
|
287
342
|
}
|
|
288
343
|
if (anySubmissionFailed) {
|
|
289
344
|
logger.error("One or more operations failed during 'publish-changed-workblocks'.");
|
|
@@ -293,5 +348,29 @@ commander_1.program
|
|
|
293
348
|
logger.log("'publish-changed-workblocks' completed successfully.");
|
|
294
349
|
}
|
|
295
350
|
});
|
|
351
|
+
commander_1.program
|
|
352
|
+
.command("list-changed-workblocks")
|
|
353
|
+
.description("List workblock directories that have changes based on git diff")
|
|
354
|
+
.requiredOption("-b, --workblock-base-dir <dir>", "Base directory within the workspace where workblocks are located")
|
|
355
|
+
.option("-w, --workspace <path>", "Path to the git workspace root", ".")
|
|
356
|
+
.option("--git-diff-base <ref>", "Base ref for git diff (e.g., HEAD^, origin/main)", "HEAD^")
|
|
357
|
+
.option("--git-diff-head <ref>", "Head ref for git diff", "HEAD")
|
|
358
|
+
.action(async (options) => {
|
|
359
|
+
const { workblockBaseDir, workspace, gitDiffBase, gitDiffHead } = options;
|
|
360
|
+
try {
|
|
361
|
+
const changedWorkblocks = await findChangedWorkblocks(workblockBaseDir, workspace, gitDiffBase, gitDiffHead, logger);
|
|
362
|
+
if (changedWorkblocks.length === 0) {
|
|
363
|
+
logger.log("No changed workblock directories found.");
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
// Output the directories to stdout (one per line) for easy consumption by other commands
|
|
367
|
+
process.stdout.write(changedWorkblocks.join("\n") + "\n");
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
371
|
+
logger.error(`Error: ${errorMessage}`);
|
|
372
|
+
process.exit(1);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
296
375
|
commander_1.program.parse(process.argv);
|
|
297
376
|
//# sourceMappingURL=cli.js.map
|
package/out/lib/logger.js
CHANGED
package/out/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":";;;AAQA,uCAAuC;AACvC,MAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":";;;AAQA,uCAAuC;AACvC,MAAa,aAAa;IACxB,GAAG,CAAC,OAAe;QACjB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CACF;AARD,sCAQC;AAED,2CAA2C;AAC3C,MAAa,YAAY;IACH;IAApB,YAAoB,aAAmC;QAAnC,kBAAa,GAAb,aAAa,CAAsB;IAAG,CAAC;IAE3D,GAAG,CAAC,OAAe;QACjB,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;CACF;AAVD,oCAUC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publisher": "beyondwork",
|
|
4
4
|
"displayName": "Beyond Work",
|
|
5
5
|
"description": "Beyond Work is a tool for managing your work in a way that is easy to use and understand.",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.10",
|
|
7
7
|
"engines": {
|
|
8
8
|
"vscode": "^1.94.0",
|
|
9
9
|
"node": ">=16.0.0"
|