Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made the same "cwd" for both IIS and cmd #140

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generators/app/templates/infrastructure/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**/.gitignore
**/Dockerfile*
**/node_modules
**/iisnode
LICENSE
README.md
.dockerignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build/Release
# Dependency directories
node_modules/
jspm_packages/
iisnode/

# TypeScript v1 declaration files
typings/
Expand Down
18 changes: 13 additions & 5 deletions generators/app/templates/infrastructure/src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
//env
const dotenv = require('dotenv');
const result = dotenv.config();
process.chdir(`${__dirname}/..`)
const dotenv = require('dotenv')
const result = dotenv.config()
if (result.error) {
const path = `.env`;
dotenv.config({ path });
console.warn('No .env file found in current working directory:', result.error)
const path = `.env`
const pathResult = dotenv.config({ path })
if (pathResult.error) {
console.warn('No .env file found in project root directory:', pathResult.error)
}
}

if (process.env.NODE_ENV) {
dotenv.config({ path: `./.env.${process.env.NODE_ENV}`, override: true });
const nodeEnvResult = dotenv.config({ path: `./.env.${process.env.NODE_ENV}`, override: true })
if (nodeEnvResult.error) {
console.warn(`No .env.${process.env.NODE_ENV} file found in project root directory:`, nodeEnvResult.error)
}
}

const keyPerFileEnv = require('@totalsoft/key-per-file-configuration')
Expand Down
Loading