Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
189b18fc
...
189b18fc09740f13a458b9c04177bc0285ede7bc
authored
2013-02-24 23:47:27 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
less agressively fix fs.dirname() issue
1 parent
6df047da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
189b18f
...
...
@@ -108,8 +108,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
}
if
(
!
fs
.
hasOwnProperty
(
'dirname'
))
{
fs
.
dirname
=
function
dirname
(
path
)
{
var
dir
=
path
.
replace
(
/
\\
/g
,
'/'
).
replace
(
/
\/[^\/]
*$/
,
''
);
return
dir
===
path
?
'.'
:
dir
;
return
path
.
replace
(
/
\\
/g
,
'/'
).
replace
(
/
\/[^\/]
*$/
,
''
);
};
}
if
(
!
fs
.
hasOwnProperty
(
'isWindows'
))
{
...
...
@@ -239,7 +238,11 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
}
if
(
!
phantom
.
casperScriptBaseDir
)
{
phantom
.
casperScriptBaseDir
=
fs
.
absolute
(
fs
.
dirname
(
phantom
.
casperScript
));
var
scriptDir
=
fs
.
dirname
(
phantom
.
casperScript
);
if
(
scriptDir
===
phantom
.
casperScript
)
{
scriptDir
=
'.'
;
}
phantom
.
casperScriptBaseDir
=
fs
.
absolute
(
scriptDir
);
}
// filter out the called script name from casper args
...
...
Please
register
or
sign in
to post a comment