Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename file to avoid codesign bug on macos catalina #143

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
node_modules
Binary file modified magic/magic.mgc
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmmagic",
"version": "0.5.3",
"version": "0.5.4",
"author": "Brian White <mscdex@mscdex.net>",
"description": "An async libmagic binding for node.js for detecting content types by data inspection",
"main": "./lib/index",
Expand Down
Binary file added test/fixtures/doc_as_doc.docx
Binary file not shown.
Binary file added test/fixtures/doc_as_zip.docx
Binary file not shown.
File renamed without changes.
24 changes: 23 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var tests = [
},
{ run: function() {
var magic = new mmm.Magic(mmm.MAGIC_MIME_TYPE);
magic.detectFile(path.join(__dirname, 'fixtures', 'tést.txt'),
magic.detectFile(path.join(__dirname, 'fixtures', 'test.txt'),
function(err, result) {
assert.strictEqual(err, null);
assert.strictEqual(result, 'text/x-c++');
Expand All @@ -87,6 +87,28 @@ var tests = [
},
what: 'detectFile - UTF-8 filename'
},
{ run: function() {
var magic = new mmm.Magic(mmm.MAGIC_MIME_TYPE);
magic.detectFile(path.join(__dirname, 'fixtures', 'doc_as_zip.docx'),
function(err, result) {
assert.strictEqual(err, null);
assert.strictEqual(result, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document');
next();
});
},
what: 'detectFile - docx as zip file'
},
{ run: function() {
var magic = new mmm.Magic(mmm.MAGIC_MIME_TYPE);
magic.detectFile(path.join(__dirname, 'fixtures', 'doc_as_doc.docx'),
function(err, result) {
assert.strictEqual(err, null);
assert.strictEqual(result, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document');
next();
});
},
what: 'detectFile - docx as docx file'
},
{ run: function() {
var buf = fs.readFileSync(path.join(__dirname, '..', 'src', 'binding.cc'));
var magic = new mmm.Magic(mmm.MAGIC_MIME_TYPE);
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


nan@^2.13.2:
version "2.14.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==