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 72bc6d15
authored
Dec 09, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1069 from peaches/master
Support relative custom config paths
2 parents
1ddcdb06
55616c2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
bin/sequelize
bin/sequelize
View file @
72bc6d1
...
...
@@ -22,6 +22,15 @@ var relativeConfigFile = function() {
return
path
.
relative
(
process
.
cwd
(),
configuration
.
configFile
)
}
// Taken from
// http://stackoverflow.com/questions/15375544/how-can-i-robustly-detect-a-relative-path-in-node-js/17521358#17521358
var
isRelativePath
=
function
(
p
)
{
var
normal
=
path
.
normalize
(
p
)
,
absolute
=
path
.
resolve
(
p
);
return
normal
!=
absolute
;
}
var
writeDefaultConfig
=
function
(
config
)
{
var
configPath
=
path
.
dirname
(
configuration
.
configFile
)
...
...
@@ -109,7 +118,11 @@ program
.
parse
(
process
.
argv
)
if
(
typeof
program
.
config
===
'string'
)
{
configuration
.
configFile
=
program
.
config
if
(
isRelativePath
(
program
.
config
))
{
configuration
.
configFile
=
path
.
join
(
process
.
cwd
(),
program
.
config
);
}
else
{
configuration
.
configFile
=
program
.
config
}
}
if
(
typeof
program
.
env
===
'string'
)
{
...
...
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