You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When scaffolding the project on Linux (NixOS in my specific case) and running the ./start-database.sh script sed throws the following error:
The issue seems to stem from sed expecting a blank space between the -i flag and the single quotes on macOS, but does not require this on Linux (Linux expects -i'' or simply -i). This appears to be the case because macOS uses BSD sed while Linux uses GNU sed.
Adjusting the ./start-database.sh script as follows seems to fix it for me:
# Generate a random URL-safe password
DB_PASSWORD=$(openssl rand -base64 12 | tr '+/' '-_')
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s#:password@#:$DB_PASSWORD@#" .env
else
sed -i "s#:password@#:$DB_PASSWORD@#" .env
fi
The text was updated successfully, but these errors were encountered:
Provide environment information
System:
OS: Linux 6.13 cpe:/o:nixos:nixos:25.05 25.05 (Warbler)
CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
Memory: 7.75 GB / 15.24 GB
Container: Yes
Shell: 5.9 - /run/current-system/sw/bin/zsh
Binaries:
Node: 22.14.0 - /etc/profiles/per-user/moshpitcodes/bin/node
npm: 10.9.2 - /etc/profiles/per-user/moshpitcodes/bin/npm
pnpm: 10.6.3 - /etc/profiles/per-user/moshpitcodes/bin/pnpm
Describe the bug
When scaffolding the project on Linux (NixOS in my specific case) and running the
./start-database.sh
scriptsed
throws the following error:The issue seems to stem from
sed
expecting a blank space between the-i
flag and the single quotes on macOS, but does not require this on Linux (Linux expects-i''
or simply-i
). This appears to be the case because macOS uses BSDsed
while Linux uses GNUsed
.Reproduction repo
https://github.com/t3-oss/create-t3-app/
To reproduce
pnpm create t3-app@latest
./start-database.sh
Additional information
Adjusting the
./start-database.sh
script as follows seems to fix it for me:The text was updated successfully, but these errors were encountered: