Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integrations/upgrade/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,7 @@ test(
`,
},
},
async ({ exec, fs, expect }) => {
async ({ exec, root, fs, expect }) => {
await exec('npx @tailwindcss/upgrade')

let before = await fs.dumpFiles('./src/**/*.{css,html}')
Expand Down Expand Up @@ -2855,7 +2855,7 @@ test(
`)

// Commit the changes
if (isRepoDirty()) {
if (isRepoDirty(root)) {
await exec('git add .')
await exec('git commit -m "upgrade"')
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"prettier-plugin-embed": "^0.5.0",
"prettier-plugin-organize-imports": "^4.3.0",
"tsup": "^8.5.0",
"turbo": "^2.5.4",
"turbo": "2.5.8",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/@tailwindcss-standalone/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { fileURLToPath } from 'node:url'
const __dirname = fileURLToPath(new URL('.', import.meta.url))

async function buildForPlatform(triple: string, outfile: string) {
console.log({ USERPROFILE: process.env.USERPROFILE })
console.log({ cwd: process.cwd() })

// We wrap this in a retry because occasionally the atomic rename fails for some reason
for (let i = 0; i < 5; ++i) {
try {
Expand All @@ -16,6 +19,9 @@ async function buildForPlatform(triple: string, outfile: string) {
// statically bundle the proper binaries for musl vs glibc
cmd = cmd.env({
PLATFORM_LIBC: triple.includes('-musl') ? 'musl' : 'glibc',

// This is a fix for binary downloads failing on Windows CI
USERPROFILE: '',
})

return await cmd
Expand Down
4 changes: 2 additions & 2 deletions packages/@tailwindcss-upgrade/src/utils/git.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { execSync } from 'node:child_process'

export function isRepoDirty() {
export function isRepoDirty(cwd?: string) {
try {
let stdout = execSync('git status --porcelain', { encoding: 'utf-8' })
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
Expand Down
73 changes: 29 additions & 44 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.