Unverified Commit f9f0f335 authored by Darsh Patel's avatar Darsh Patel Committed by GitHub

fix: use node copyFile for cross-platform support (#48740)

Fixes: #48712

Use node copyFile in the package.json script for cross-platform support 
Co-authored-by: 's avatarSteven <229881+styfle@users.noreply.github.com>
parent aaf7fa5d
const fs = require('fs')
if (fs.existsSync('../.env')) {
fs.copyFileSync('../.env', '.env.development')
} else if (fs.existsSync('../.env.local')) {
fs.copyFileSync('../.env.local', '.env.development')
} else {
throw new Error('No .env or .env.local file found at root of the project')
}
......@@ -8,7 +8,7 @@
"deploy": "sanity deploy",
"prestart": "npm run env",
"predeploy": "npm run env",
"env": "cp ../.env .env.development || cp ../.env.local .env.development"
"env": "node copyEnv.js"
},
"dependencies": {
"sanity": "^3.2.6",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment