Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/diff-docx.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ async function main() {
process.exit(1);
}

const baselinePath = args[0];
const currentPath = args[1];
const baselinePath = path.resolve(args[0]);
const currentPath = path.resolve(args[1]);
const outputIndex = args.indexOf('--output');
const outputPath = outputIndex !== -1 ? args[outputIndex + 1] : null;
const outputPath = outputIndex !== -1 ? path.resolve(args[outputIndex + 1]) : null;

if (outputPath && !outputPath.startsWith(process.cwd() + path.sep)) {
console.error('Output path must be within the current working directory');
process.exit(1);
}

if (!fs.existsSync(baselinePath)) {
console.error(`Baseline file not found: ${baselinePath}`);
Expand Down
Loading