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
ac9fc83c
...
ac9fc83cadf18e29e9c2985b5a72bbb2eef545b0
authored
2012-01-02 09:55:50 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed --casper-path arg parsing
1 parent
ca5fdb6a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
ac9fc83
...
...
@@ -63,14 +63,21 @@ if (!phantom.casperLoaded) {
})(
require
(
'fs'
));
// casper root path
// TODO: take --casper-path=.* from python executable
if
(
!
phantom
.
casperPath
)
{
phantom
.
casperPath
=
fs
.
absolute
(
phantom
.
args
.
map
(
function
(
arg
)
{
var
match
=
arg
.
match
(
/--casper-path=
(
.*
)
/i
);
try
{
phantom
.
casperPath
=
phantom
.
args
.
map
(
function
(
i
)
{
var
match
=
i
.
match
(
/^--casper-path=
(
.*
)
/
);
if
(
match
)
{
return
match
[
1
];
return
fs
.
absolute
(
match
[
1
]);
}
}).
filter
(
function
(
path
)
{
return
fs
.
isDirectory
(
path
);
}).
pop
();
}
catch
(
e
)
{}
}
}).
pop
());
if
(
!
phantom
.
casperPath
)
{
console
.
error
(
"Couldn't find not compute phantom.casperPath, exiting."
);
phantom
.
exit
(
1
);
}
// Embedded, up-to-date, validatable & controlable CoffeeScript
...
...
Please
register
or
sign in
to post a comment