mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix(windows): ensure drive letter is uppercase (#8741)
This commit is contained in:
parent
a0dc79b946
commit
c4a7ec4255
2 changed files with 12 additions and 0 deletions
5
.changeset/large-clouds-sip.md
Normal file
5
.changeset/large-clouds-sip.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixed an issue on Windows where lowercase drive letters in current working directory led to missing scripts and styles.
|
|
@ -32,6 +32,13 @@ async function main() {
|
|||
}
|
||||
}
|
||||
|
||||
// windows drive letters can sometimes be lowercase, which vite cannot process
|
||||
if (process.platform === 'win32') {
|
||||
const cwd = process.cwd()
|
||||
const correctedCwd = cwd.slice(0, 1).toUpperCase() + cwd.slice(1)
|
||||
if (correctedCwd !== cwd) process.chdir(correctedCwd)
|
||||
}
|
||||
|
||||
return import('./dist/cli/index.js')
|
||||
.then(({ cli }) => cli(process.argv))
|
||||
.catch((error) => {
|
||||
|
|
Loading…
Reference in a new issue