Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
/.playwright-cli/
# Ignore self-skill which is a build artifact
.claude/skills/playwright-cli/
.npmrc
3 changes: 2 additions & 1 deletion skillCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function installedSkillTargets() {
* @returns
*/
function readSkill(file) {
return fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : null;
// Normalize line endings, they could be affected by git or editor settings.
return fs.existsSync(file) ? fs.readFileSync(file, 'utf8').replace(/\r\n/g, '\n') : null;
}

/**
Expand Down
13 changes: 13 additions & 0 deletions tests/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,16 @@ test('warns when installed skill is out of date', async ({}) => {
error: expect.stringContaining('does not match the tool version'),
}));
});

test('does not warn when installed skill only differs in line endings', async ({}) => {
expect(await runCli('install', '--skills')).toEqual(expect.objectContaining({
exitCode: 0,
}));

const skillFile = path.join(test.info().outputPath(), '.claude', 'skills', 'playwright-cli', 'SKILL.md');
fs.writeFileSync(skillFile, fs.readFileSync(skillFile, 'utf8').replace(/\n/g, '\r\n'));

expect(await runCli('--help')).toEqual(expect.objectContaining({
error: expect.not.stringContaining('does not match the tool version'),
}));
});