Skip to content

Commit

Permalink
Add: script to generate .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
rdig committed Nov 8, 2022
1 parent 01b076d commit 08847ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"dev": "ts-node-dev src/index.ts",
"prod": "npm run build && NODE_ENV=production npm run start",
"typecheck": "tsc --noEmit",
"lint": "eslint src/ --ext .ts"
"lint": "eslint src/ --ext .ts",
"preinstall": "bash scripts/generate-temp-files.sh"
},
"repository": {
"type": "git",
Expand Down
13 changes: 13 additions & 0 deletions scripts/generate-temp-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

ENV_FILE=".env"

echo -e "Generating local specific, temporary files\n"

# Setup the env file
if [ -f "$ENV_FILE" ]; then
echo "The .env file already exists, skip generating it"
else
echo "Generating the .env file"
cp .env.example $ENV_FILE
fi

0 comments on commit 08847ed

Please sign in to comment.