Skip to content

Commit

Permalink
change date output
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-RA committed Aug 16, 2016
1 parent faf6c60 commit fa9d026
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,24 @@ whois(process.env.DOMAIN_NAME, function(err, data) {
console.log(err);
process.exit(1);
}
var expiry = new Date(Date.parse(data.registryExpiryDate));

var result = {
type: 'DNS',
expiry: expiry.toString(),
expiry: 'No Data',
};
var expiry;

if (data.registryExpiryDate) {
expiry = new Date(Date.parse(data.registryExpiryDate));
expiry = expiry.toString();
}

// Output results
if (process.env.VERBOSE) {
console.log(JSON.stringify(result, null, 2));
if (!expiry) {
process.exit(0);
}
}

// DNS is going to expire soon
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hon-ssl-verification",
"version": "1.0.0",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit fa9d026

Please sign in to comment.