Skip to content

run-if-changed doesn't detect directory changes #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thelinuxlich opened this issue Jan 28, 2025 · 4 comments
Closed

run-if-changed doesn't detect directory changes #123

thelinuxlich opened this issue Jan 28, 2025 · 4 comments

Comments

@thelinuxlich
Copy link

I've added the following config to my package.json:

"run-if-changed": {
		"pnpm-lock.yaml": "pnpm i",
		"prisma": "pnpm migrate-all"
}

When pnpm-lock.yaml is modified, pnpm i runs, but when a file is updated or added inside the prisma folder, run-if-changed doesn't detect it.

@hkdobrev
Copy link
Owner

@thelinuxlich Good catch! This is actually a documentation problem.

You should be able to configure it using wildcards:

"run-if-changed": {
	"pnpm-lock.yaml": "pnpm i",
	"prisma/**": "pnpm migrate-all"
}

run-if-changed is using micromatch to match patterns and files in directories can be matched using globstars (**).

Please let me know if that works for you and I'll update the readme with this.

@thelinuxlich
Copy link
Author

Tried with prisma/** same thing happening :(

@hkdobrev
Copy link
Owner

hkdobrev commented Feb 3, 2025

@thelinuxlich I was finally able to test it and foo/** works for me.

Could you please check the different hooks are installed properly?
Can you share a reproducible example?
Could you confirm the exact version of `run-if-changed you have installed?

Thank you!

@thelinuxlich
Copy link
Author

It was my mistake, specifying prisma/**/*.sql worked!

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

No branches or pull requests

2 participants