Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 8b9dcff6
authored
Sep 12, 2013
by
Brad Harris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
require config file to allow for json or js files
1 parent
a8ce9570
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
bin/sequelize
bin/sequelize
View file @
8b9dcff
...
...
@@ -77,16 +77,15 @@ var createMigrationsFolder = function(force) {
var
readConfig
=
function
()
{
var
config
try
{
config
=
fs
.
readFileSync
(
configuration
.
configFile
)
config
=
require
(
configuration
.
configFile
);
}
catch
(
e
)
{
throw
new
Error
(
'Error reading "'
+
relativeConfigFile
()
+
'".'
)
}
try
{
config
=
JSON
.
parse
(
config
)
}
catch
(
e
)
{
throw
new
Error
(
'Error parsing "'
+
relativeConfigFile
()
+
'" as JSON.'
)
if
(
typeof
config
!=
'object'
)
{
throw
new
Error
(
'Config must be an object: '
+
relativeConfigFile
());
}
console
.
log
(
'Loaded configuration file "'
+
relativeConfigFile
()
+
'".'
)
if
(
config
[
configuration
.
environment
])
{
console
.
log
(
'Using environment "'
+
configuration
.
environment
+
'".'
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment