Describe the bug
The two policy-validation npm scripts in package.json are identical:
"policy-validation": "npx tsx scripts/policy-validation.ts",
"policy-validation:force-rewrite": "npx tsx scripts/policy-validation.ts"
scripts/policy-validation.ts reads its force flag with
process.argv.includes('--force-rewrite'), but neither script ever passes
it, so npm run policy-validation:force-rewrite <platform> behaves exactly
like npm run policy-validation <platform>: it loads the existing platform
policy instead of starting from an empty policyDocuments list.
To Reproduce
- Run
npm run policy-validation:force-rewrite instagram.
- The run takes the
getPlatformPolicy(platform) branch, not the
force-rewrite branch, so the existing policy documents are reused.
Expected behavior
policy-validation:force-rewrite should pass --force-rewrite so the
script takes the force-rewrite path.
Additional context
Once the flag is actually passed, the platform argument also needs
attention: it is read as process.argv[2], which is whichever argument
comes first, so a leading flag would be picked up as the platform name.
Reading the platform as the first non-flag argument fixes both together.
I have a small patch ready for this and can open a PR against it.
Describe the bug
The two policy-validation npm scripts in
package.jsonare identical:scripts/policy-validation.tsreads its force flag withprocess.argv.includes('--force-rewrite'), but neither script ever passesit, so
npm run policy-validation:force-rewrite <platform>behaves exactlylike
npm run policy-validation <platform>: it loads the existing platformpolicy instead of starting from an empty
policyDocumentslist.To Reproduce
npm run policy-validation:force-rewrite instagram.getPlatformPolicy(platform)branch, not theforce-rewrite branch, so the existing policy documents are reused.
Expected behavior
policy-validation:force-rewriteshould pass--force-rewriteso thescript takes the force-rewrite path.
Additional context
Once the flag is actually passed, the platform argument also needs
attention: it is read as
process.argv[2], which is whichever argumentcomes first, so a leading flag would be picked up as the platform name.
Reading the platform as the first non-flag argument fixes both together.
I have a small patch ready for this and can open a PR against it.