summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Arsh <69170106+lilnasy@users.noreply.github.com> 2023-10-09 15:58:09 +0000
committerGravatar GitHub <noreply@github.com> 2023-10-09 16:58:09 +0100
commitc4a7ec4255e7acb9555cb8bb74ea13c5fbb2ac17 (patch)
tree49f8b41498b19f400c38e052832383cea5b644a3
parenta0dc79b94673567e97f0031c84b919f07789a3db (diff)
downloadastro-c4a7ec4255e7acb9555cb8bb74ea13c5fbb2ac17.tar.gz
astro-c4a7ec4255e7acb9555cb8bb74ea13c5fbb2ac17.tar.zst
astro-c4a7ec4255e7acb9555cb8bb74ea13c5fbb2ac17.zip
fix(windows): ensure drive letter is uppercase (#8741)
-rw-r--r--.changeset/large-clouds-sip.md5
-rwxr-xr-xpackages/astro/astro.js7
2 files changed, 12 insertions, 0 deletions
diff --git a/.changeset/large-clouds-sip.md b/.changeset/large-clouds-sip.md
new file mode 100644
index 000000000..c271de43c
--- /dev/null
+++ b/.changeset/large-clouds-sip.md
@@ -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.
diff --git a/packages/astro/astro.js b/packages/astro/astro.js
index f227ae9e9..b1b5106db 100755
--- a/packages/astro/astro.js
+++ b/packages/astro/astro.js
@@ -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) => {