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
14c1f1b9
...
14c1f1b98a33ea7b064669f74800e264d28f8def
authored
2012-02-14 12:33:07 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bootstrap.js now throws CasperError in case package.json does not contain valid version information
1 parent
30c45923
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
14c1f1b
...
...
@@ -131,16 +131,16 @@ phantom.loadCasper = function() {
var
fs
=
require
(
'fs'
);
pkgFile
=
fs
.
absolute
(
fs
.
pathJoin
(
path
,
'package.json'
));
if
(
!
fs
.
exists
(
pkgFile
))
{
throw
new
Error
(
'Cannot find package.json at '
+
pkgFile
);
throw
new
Casper
Error
(
'Cannot find package.json at '
+
pkgFile
);
}
try
{
pkg
=
JSON
.
parse
(
require
(
'fs'
).
read
(
pkgFile
));
}
catch
(
e
)
{
throw
new
Error
(
'Cannot read package file contents: '
+
e
);
throw
new
Casper
Error
(
'Cannot read package file contents: '
+
e
);
}
parts
=
pkg
.
version
.
trim
().
split
(
"."
);
if
(
parts
<
3
)
{
throw
new
Error
(
"Invalid version number"
);
throw
new
Casper
Error
(
"Invalid version number"
);
}
patchPart
=
parts
[
2
].
split
(
'-'
);
return
{
...
...
Please
register
or
sign in
to post a comment