Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Kitsukey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kio!
Kitsukey
Commits
2765a3c2
Commit
2765a3c2
authored
8 years ago
by
Aya Morisawa
Browse files
Options
Downloads
Patches
Plain Diff
Extract EnvironmentInfo
parent
eb10c3a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/index.ts
+2
-12
2 additions, 12 deletions
src/index.ts
src/utils/environmentInfo.ts
+13
-0
13 additions, 0 deletions
src/utils/environmentInfo.ts
with
15 additions
and
12 deletions
src/index.ts
+
2
−
12
View file @
2765a3c2
...
...
@@ -17,6 +17,7 @@ const isRoot = require('is-root');
import
ProgressBar
from
'
./utils/cli/progressbar
'
;
import
initdb
from
'
./db/mongodb
'
;
import
LastCommitInfo
from
'
./utils/lastCommitInfo
'
;
import
EnvironmentInfo
from
'
./utils/environmentInfo
'
;
import
MachineInfo
from
'
./utils/machineInfo
'
;
import
DependencyInfo
from
'
./utils/dependencyInfo
'
;
...
...
@@ -24,10 +25,6 @@ import DependencyInfo from './utils/dependencyInfo';
require
(
'
babel-core/register
'
);
require
(
'
babel-polyfill
'
);
const
env
=
process
.
env
.
NODE_ENV
;
const
IS_PRODUCTION
=
env
===
'
production
'
;
const
IS_DEBUG
=
!
IS_PRODUCTION
;
global
.
config
=
require
(
'
./config
'
).
default
(
`
${
__dirname
}
/../.config/config.yml`
);
/**
...
...
@@ -138,14 +135,7 @@ async function init(): Promise<State> {
Logger
.
info
(
'
Initializing...
'
);
await
LastCommitInfo
.
show
();
let
envLogger
=
new
Logger
(
'
Env
'
);
envLogger
.
info
(
typeof
env
==
'
undefined
'
?
'
NODE_ENV is not set
'
:
`NODE_ENV:
${
env
}
`
);
if
(
IS_DEBUG
)
{
envLogger
.
warn
(
'
The environment is not in production mode
'
);
envLogger
.
warn
(
'
Do not use for production purpose
'
);
}
EnvironmentInfo
.
show
();
MachineInfo
.
show
();
new
DependencyInfo
().
showAll
();
...
...
This diff is collapsed.
Click to expand it.
src/utils/environmentInfo.ts
0 → 100644
+
13
−
0
View file @
2765a3c2
import
Logger
from
'
./logger
'
;
export
default
class
EnvironmentInfo
{
static
show
():
void
{
const
env
=
process
.
env
.
NODE_ENV
;
let
logger
=
new
Logger
(
'
Env
'
);
logger
.
info
(
typeof
env
==
'
undefined
'
?
'
NODE_ENV is not set
'
:
`NODE_ENV:
${
env
}
`
);
if
(
env
!==
'
production
'
)
{
logger
.
warn
(
'
The environment is not in production mode
'
);
logger
.
warn
(
'
Do not use for production purpose
'
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment