Skip to content

fix(monorepo-tools): fix precommit hook#618

Open
addaleax wants to merge 1 commit intomainfrom
fix-precommit
Open

fix(monorepo-tools): fix precommit hook#618
addaleax wants to merge 1 commit intomainfrom
fix-precommit

Conversation

@addaleax
Copy link
Collaborator

This script was broken in some bizarre ways -- for example, it assumed that "monorepo root" and "root" were a) different and b) located at a fixed relative path to the filename of the precommit script, or it assumed that the repository would always have a .gitmodules file -- that make it very unclear to me how these issues went unnoticed for as long as they did.

Description

Open Questions

Checklist

This script was broken in some bizarre ways -- for example, it
assumed that "monorepo root" and "root" were a) different and
b) located at a fixed relative path to the filename of the
precommit script, or it assumed that the repository would
always have a `.gitmodules` file -- that make it very unclear
to me how these issues went unnoticed for as long as they did.
const execFileAsync = promisify(execFile);

const monorepoRoot = path.resolve(__dirname, '..', '..');
const repoRoot = path.resolve(monorepoRoot, '..');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ I can't seem to make sense of why ../.. and ../../.. were chosen to be the "monorepo root" and "repo root", respectively – but this must have been intentional, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess monorepo root is packages/ and root is the repo root? where .git is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants