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
6bab3e19
...
6bab3e19edcd8333ac2a540054f24ee274057473
authored
2011-12-18 12:05:08 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed broken ability to use Casper without using the executable
1 parent
1c3b0b8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
bin/casperjs
casper.js
bin/casperjs
View file @
6bab3e1
...
...
@@ -7,4 +7,4 @@ while [ -h "$CASPER_EXECUTABLE" ]; do
done
CASPERJS_HOME
=
"
$(
cd
-PL
"
$(
dirname
"
$CASPER_EXECUTABLE
"
)
"
&&
cd
..
&&
pwd
)
"
phantomjs
$CASPERJS_HOME
/casper.js --casper-path
=
$CASPERJS_HOME
$*
phantomjs
$CASPERJS_HOME
/casper.js --casper-path
=
$CASPERJS_HOME
--cli
$*
...
...
casper.js
View file @
6bab3e1
...
...
@@ -26,6 +26,10 @@
*
*/
(
function
(
phantom
)
{
if
(
true
===
phantom
.
casperLoaded
)
{
return
;
}
var
fs
=
require
(
'fs'
);
fs
.
pathJoin
=
function
()
{
...
...
@@ -80,18 +84,22 @@
phantom
.
injectJs
(
fs
.
pathJoin
(
phantom
.
casperPath
,
'lib'
,
lib
));
});
if
(
phantom
.
casperArgs
.
args
.
length
===
0
||
!!
phantom
.
casperArgs
.
options
.
help
)
{
console
.
log
(
'Usage: casperjs script.(js|coffee) [options...]'
);
console
.
log
(
'Read the docs http://n1k0.github.com/casperjs/'
);
phantom
.
exit
(
0
);
}
phantom
.
casperLoaded
=
true
;
phantom
.
casperScript
=
phantom
.
casperArgs
.
args
[
0
];
if
(
true
===
phantom
.
casperArgs
.
options
.
cli
)
{
if
(
phantom
.
casperArgs
.
args
.
length
===
0
||
!!
phantom
.
casperArgs
.
options
.
help
)
{
console
.
log
(
'Usage: casperjs script.(js|coffee) [options...]'
);
console
.
log
(
'Read the docs http://n1k0.github.com/casperjs/'
);
phantom
.
exit
(
0
);
}
if
(
!
fs
.
isFile
(
phantom
.
casperScript
))
{
console
.
log
(
'Unable to open file: '
+
phantom
.
casperScript
);
phantom
.
exit
(
1
);
}
phantom
.
casperScript
=
phantom
.
casperArgs
.
args
[
0
];
if
(
!
fs
.
isFile
(
phantom
.
casperScript
))
{
console
.
log
(
'Unable to open file: '
+
phantom
.
casperScript
);
phantom
.
exit
(
1
);
}
phantom
.
injectJs
(
phantom
.
casperScript
);
phantom
.
injectJs
(
phantom
.
casperScript
);
}
})(
phantom
);
...
...
Please
register
or
sign in
to post a comment