Skip to content

Commit

Permalink
Merge branch 'main' of github.com:photostructure/fs-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Nov 18, 2024
2 parents 4c88d66 + b494c71 commit 6c6f058
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 40 deletions.
116 changes: 82 additions & 34 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,92 @@
"dependencies": [
"<!(node -p \"require('node-addon-api').gyp\")"
],
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
"defines": [
"NAPI_CPP_EXCEPTIONS"
],
"conditions": [
["OS=='linux'", {
"sources": [
"src/linux/blkid_cache.cpp",
"src/linux/fs_meta.cpp"
],
"libraries": ["-lblkid"],
"cflags": ["-fPIC"],
"cflags_cc": [
"-fexceptions",
"-fPIC"
],
"conditions": [
["enable_gio=='true'", {
"sources": [
"src/linux/gio_utils.cpp",
"src/linux/gio_worker.cpp"
],
"defines": ["ENABLE_GIO=1"],
"libraries": ["<!@(pkg-config --libs gio-2.0)"],
"cflags": ["<!@(pkg-config --cflags gio-2.0)"]
}]
]
}],
["OS=='win'", {
"sources": ["src/windows/fs_meta.cpp"]
}],
["OS=='mac'", {
"sources": ["src/darwin/fs_meta.cpp"],
"link_settings": {
[
"OS=='linux'",
{
"sources": [
"src/linux/blkid_cache.cpp",
"src/linux/fs_meta.cpp"
],
"libraries": [
"DiskArbitration.framework",
"Foundation.framework",
"IOKit.framework"
"-lblkid"
],
"cflags": [
"-fPIC"
],
"cflags_cc": [
"-fexceptions",
"-fPIC"
],
"conditions": [
[
"enable_gio=='true'",
{
"sources": [
"src/linux/gio_utils.cpp",
"src/linux/gio_worker.cpp"
],
"defines": [
"ENABLE_GIO=1"
],
"libraries": [
"<!@(pkg-config --libs gio-2.0)"
],
"cflags": [
"<!@(pkg-config --cflags gio-2.0)"
]
}
]
]
}
}]
],
[
"OS=='win'",
{
"sources": [
"src/windows/fs_meta.cpp"
],
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1,
"RuntimeTypeInfo": "true"
}
}
}
],
[
"OS=='mac'",
{
"sources": [
"src/darwin/fs_meta.cpp"
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"CLANG_CXX_LIBRARY": "libc++",
"MACOSX_DEPLOYMENT_TARGET": "10.15"
},
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"cflags": [
"-fexceptions",
"-fPIC"
],
"cflags_cc": [
"-fexceptions"
],
"link_settings": {
"libraries": [
"DiskArbitration.framework",
"Foundation.framework",
"IOKit.framework"
]
}
}
]
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ts_eslint from "typescript-eslint";
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["src/**/*.ts", "scripts/*.js", "*.js"] },
{ ignores: ["dist", "build", ".tsup", "coverage"] },
{ ignores: [".tsup", "build", "coverage", "dist", "docs"] },
pluginJs.configs.recommended,
...ts_eslint.configs.recommended,
];
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"lint:fix": "eslint --fix",
"fmt": "run-p fmt:*",
"// fmt:cpp": "on ubuntu: `sudo apt install clang-format`",
"fmt:cpp": "clang-format --style=LLVM -i src/*/*.cpp src/*/*.h",
"fmt:js": "prettier --write 'scripts/**/*.js' '*.js'",
"fmt:json": "prettier --write '**/*.json'",
"fmt:cpp": "clang-format --style=LLVM -i src/*/*.cpp src/*/*.h || true",
"fmt:js": "prettier --write scripts/**/*.js *.js",
"fmt:json": "prettier --write **/*.json",
"fmt:pkg": "npm pkg fix",
"fmt:ts": "prettier --write 'src/**/*.ts'",
"fmt:ts": "prettier --write src/**/*.ts",
"prepublishOnly": "npm run test && npm run build",
"prepack": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/fs_metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("Filesystem Metadata", () => {
getVolumeMetadata("/nonexistent", {
onlyDirectories: false,
}),
).rejects.toThrow(/Failed to get volume statistics/);
).rejects.toThrow(/Failed to get volume (statistics|information)/);
});

it("handles non-existant mount points (from js)", async () => {
Expand Down

0 comments on commit 6c6f058

Please sign in to comment.