version bump 0.7.0: removing unnecessary try-catch

Instead of a fixed check, assume that the references are relative if they are
not absolute
This commit is contained in:
SheetJS 2013-11-13 15:36:47 -08:00
parent 99d86f01b7
commit 5c79a6ee30
5 changed files with 26 additions and 21 deletions

@ -1,4 +1,4 @@
Copyright 2013 Niggler
Copyright 2013 SheetJS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

@ -6,7 +6,7 @@ lint:
jshint cfb.js
init:
if [ ! -e test_files ]; then git clone https://github.com/Niggler/test_files; fi
if [ ! -e test_files ]; then git clone https://github.com/SheetJS/test_files; fi
cd test_files; make
clean:

21
bin/cfb

@ -1,19 +1,26 @@
#!/usr/bin/env node
var CFB = require('../cfb');
var args = process.argv.slice(2);
var fs = require('fs'), program = require('commander');
program
.version('0.7.0')
.usage('[options] <file>')
.option('-q, --quiet', 'print but do not extract')
.parse(process.argv);
if(args.length === 0 || !require('fs').existsSync(args[0])) {
console.error("Usage: " + process.argv[1] + " <cfb_file>");
if(program.args.length === 0 || !fs.existsSync(program.args[0])) {
console.error("Usage: " + process.argv[1] + " [-q] <cfb_file>");
process.exit(1);
}
var cfb = CFB.read(args[0], {type:'file'});
if(args[1] === "-q") {
console.log(cfb);
var cfb = CFB.read(program.args[0], {type:'file'});
if(program.quiet) {
console.log("Full Paths:")
console.log(cfb.FullPaths.map(function(x) { return " " + x; }).join("\n"));
console.log("Full Path Directory:")
console.log(cfb.FullPathDir);
return;
}
var fs = require('fs');
for(var i=0; i != cfb.FullPaths.length; ++i) {
if(cfb.FullPaths[i].slice(-1) === "/") {
console.error("mkdir " + cfb.FullPaths[i]);

11
cfb.js

@ -322,14 +322,9 @@ function read_directory(idx) {
minifat_size = o.size;
} else if(o.size >= ms_cutoff_size) {
o.storage = 'fat';
try {
sector_list[o.start].name = o.name;
o.content = sector_list[o.start].data.slice(0,o.size);
} catch(e) {
o.start = o.start - 1;
sector_list[o.start].name = o.name;
o.content = sector_list[o.start].data.slice(0,o.size);
}
if(!sector_list[o.start] && dir_start > 0) o.start = (o.start + dir_start) % sectors.length;
sector_list[o.start].name = o.name;
o.content = sector_list[o.start].data.slice(0,o.size);
prep_blob(o.content);
} else {
o.storage = 'minifat';

@ -1,17 +1,20 @@
{
"name": "cfb",
"version": "0.6.0",
"author": "Niggler",
"version": "0.7.0",
"author": "SheetJS",
"description": "Compound File Binary File Format extractor",
"keywords": [ "cfb", "compression", "office" ],
"bin": {
"cfb": "./bin/cfb"
},
"main": "./cfb",
"repository": { "type":"git", "url":"git://github.com/Niggler/js-cfb.git" },
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-cfb.git" },
"scripts": {
"test": "make test"
},
"bugs": { "url": "https://github.com/Niggler/js-cfb/issues" },
"dependencies": {
"commander":""
},
"bugs": { "url": "https://github.com/SheetJS/js-cfb/issues" },
"license": "Apache 2.0"
}