null+****@clear*****
null+****@clear*****
2012年 6月 20日 (水) 16:05:33 JST
Yoji SHIDARA 2012-06-20 16:05:33 +0900 (Wed, 20 Jun 2012) New Revision: 7649a9b4a74883a378d486ec3a3e2111d5158b20 https://github.com/groonga/gcs/commit/7649a9b4a74883a378d486ec3a3e2111d5158b20 Log: Create database directory if not exists Modified files: lib/database.js Modified: lib/database.js (+5 -2) =================================================================== --- lib/database.js 2012-06-20 16:04:16 +0900 (f552a17) +++ lib/database.js 2012-06-20 16:05:33 +0900 (0a546b9) @@ -1,5 +1,7 @@ var nroonga = require('nroonga'); var Deferred = require('jsdeferred').Deferred; +var path = require('path'); +var mkdirp = require('mkdirp'); var ShortText = exports.ShortText = @@ -30,9 +32,10 @@ var TokenBigram = Database.TokenBigram = 'TokenBigram'; function Database(source) { - if (typeof source == 'string') // path + if (typeof source == 'string') { // path + mkdirp.sync(path.dirname(source)); this._database = new nroonga.Database(source); - else if (source instanceof nroonga.Database) + } else if (source instanceof nroonga.Database) this._database = source; else return source; -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... 下載