[Pkg-javascript-commits] [node-keygrip] 18/68: changed referencing to location of defaultKeys.json

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Fri Jun 27 22:13:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to branch master
in repository node-keygrip.

commit 5d5bb282ac8ac6a2426cf01302bf1838c3cd4310
Author: Jed Schmidt <tr at nslator.jp>
Date:   Tue Mar 1 11:13:21 2011 +0900

    changed referencing to location of defaultKeys.json
---
 lib/defaultKeys.json |  1 -
 lib/keygrip.js       | 13 ++++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/lib/defaultKeys.json b/lib/defaultKeys.json
deleted file mode 100644
index a40014e..0000000
--- a/lib/defaultKeys.json
+++ /dev/null
@@ -1 +0,0 @@
-["9d28a2aba7f42d0db53c3a3fbf817f6c"]
\ No newline at end of file
diff --git a/lib/keygrip.js b/lib/keygrip.js
index 12db11e..519d02e 100644
--- a/lib/keygrip.js
+++ b/lib/keygrip.js
@@ -2,18 +2,17 @@ crypto = require( "crypto" )
 path = require( "path" )
 fs = require( "fs" )
 
-defaults = path.existsSync( "lib/defaultKeys.json" )
-  ? JSON.parse( fs.readFileSync( "lib/defaultKeys.json" ) )
+keysPath = path.join( __dirname, "defaultKeys.json" )
+
+defaults = path.existsSync( keysPath )
+  ? JSON.parse( fs.readFileSync( keysPath ) )
   : undefined
 
 function Keygrip( keys ) {
   if ( !( this instanceof Keygrip ) ) return new Keygrip( keys )
   
   if ( !keys || !( 0 in keys ) ) {
-    if ( defaults ) {
-      console.warn( "No keys specified, using defaults instead." )
-      keys = defaults
-    }
+    if ( keys = defaults ) console.warn( "No keys specified, using defaults instead." )
     
     else throw "Keys must be provided or default keys must exist."
   }
@@ -42,7 +41,7 @@ function Keygrip( keys ) {
   }
 }
 
-Keygrip.sign = Keygrip.verify = function() {
+Keygrip.sign = Keygrip.verify = Keygrip.index = function() {
   throw "Usage: require( 'keygrip' )( <array-of-keys> )"
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-keygrip.git



More information about the Pkg-javascript-commits mailing list