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 55616c2d
authored
Nov 25, 2013
by
Anh-Kiet Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the way relative paths are checked
1 parent
6652ef62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
bin/sequelize
bin/sequelize
View file @
55616c2
...
@@ -22,6 +22,15 @@ var relativeConfigFile = function() {
...
@@ -22,6 +22,15 @@ var relativeConfigFile = function() {
return
path
.
relative
(
process
.
cwd
(),
configuration
.
configFile
)
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
writeDefaultConfig
=
function
(
config
)
{
var
configPath
=
path
.
dirname
(
configuration
.
configFile
)
var
configPath
=
path
.
dirname
(
configuration
.
configFile
)
...
@@ -109,10 +118,10 @@ program
...
@@ -109,10 +118,10 @@ program
.
parse
(
process
.
argv
)
.
parse
(
process
.
argv
)
if
(
typeof
program
.
config
===
'string'
)
{
if
(
typeof
program
.
config
===
'string'
)
{
if
(
program
.
config
[
0
]
===
'/'
)
{
if
(
isRelativePath
(
program
.
config
))
{
configuration
.
configFile
=
program
.
config
}
else
{
configuration
.
configFile
=
path
.
join
(
process
.
cwd
(),
program
.
config
);
configuration
.
configFile
=
path
.
join
(
process
.
cwd
(),
program
.
config
);
}
else
{
configuration
.
configFile
=
program
.
config
}
}
}
}
...
...
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