The Bun build issue was caused by Turborepo passing through `USERPROFILE` from the env. Probably need to file a bug with Bun: ``` Works: env: USERPROFILE: undefined CWD: `D:\a\tailwindcss\tailwindcss\packages\@tailwindcss-standalone` Fails: env: USERPROFILE: "C:\Users\runneradmin" CWD: `D:\a\tailwindcss\tailwindcss\packages\@tailwindcss-standalone` ```
17 lines
530 B
TypeScript
17 lines
530 B
TypeScript
import { execSync } from 'node:child_process'
|
|
|
|
export function isRepoDirty(cwd?: string) {
|
|
try {
|
|
let stdout = execSync('git status --porcelain', { encoding: 'utf-8', cwd })
|
|
return stdout.trim() !== ''
|
|
} catch (error) {
|
|
// If it's not a git repository we don't know if it's dirty or not. But we
|
|
// also don't want to block the migration. Maybe we can still fail and
|
|
// require a `--force` flag?
|
|
if (error?.toString?.().includes('not a git repository')) {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|
|
}
|