Skip to content

Instantly share code, notes, and snippets.

@pyronaur
pyronaur / fix.mjs
Last active January 26, 2023 10:55
Auto-fix all changed files in the Jetpack Monorepo
#!/usr/bin/env zx
// Pass --verbose to see the full output
$.verbose = argv.verbose;
function isPHP(filename) {
return filename.match(/\.php$/);
}
function isJS(filename) {
@pyronaur
pyronaur / mono.mjs
Created February 7, 2023 16:48
Monorepo fixer
#!/usr/bin/env zx
// Pass --verbose to see the full output
$.verbose = argv.verbose;
const php = {
is: (file) => file.match(/\.php$/),
fix: async (file) => {
const result = await nothrow($`pnpm run -w php:autofix ${file}`);
// php:autofix outputs the fixes to stderr for some reason.