feat(atlassian): implement milestone M4 - packaging and doc sync
This commit is contained in:
13
skills/atlassian/cursor/scripts/src/files.ts
Normal file
13
skills/atlassian/cursor/scripts/src/files.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
export async function readWorkspaceFile(filePath: string, cwd: string) {
|
||||
const resolved = path.resolve(cwd, filePath);
|
||||
const relative = path.relative(cwd, resolved);
|
||||
|
||||
if (relative.startsWith("..") || path.isAbsolute(relative)) {
|
||||
throw new Error(`--body-file must stay within the active workspace: ${filePath}`);
|
||||
}
|
||||
|
||||
return readFile(resolved, "utf8");
|
||||
}
|
||||
Reference in New Issue
Block a user