-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rename
bin-wrapper
to bin-wrappers
- Loading branch information
1 parent
ca584fb
commit deb77ad
Showing
6 changed files
with
58 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use strict"; | ||
|
||
const binWrappers = require("../src/bin-wrappers"); | ||
const binCheck = require("bin-check"); | ||
|
||
describe("bin wrapper instances", () => { | ||
it("should work", () => | ||
Promise.all([ | ||
expect(binCheck(binWrappers.cjpeg.path(), ["-version"])).resolves.toBe( | ||
true | ||
), | ||
expect(binCheck(binWrappers.djpeg.path(), ["-version"])).resolves.toBe( | ||
true | ||
), | ||
expect(binCheck(binWrappers.jpegtran.path(), ["-version"])).resolves.toBe( | ||
true | ||
), | ||
expect(binCheck(binWrappers.rdjpgcom.path(), ["-help"])).rejects.toThrow( | ||
"rdjpgcom displays any textual comments in a JPEG file." | ||
), | ||
expect( | ||
binCheck(binWrappers.tjbench.path(), ["-version"]) | ||
).rejects.toThrow("tjbench"), | ||
expect( | ||
binCheck(binWrappers.wrjpgcom.path(), ["-version"]) | ||
).rejects.toThrow("wrjpgcom inserts a textual comment in a JPEG file.") | ||
])); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
const BinWrappers = require("bin-wrapper"); | ||
|
||
const dest = path.join(__dirname, "../vendor"); | ||
const isWin = process.platform === "win32"; | ||
|
||
module.exports = { | ||
cjpeg: new BinWrappers().dest(dest).use(isWin ? "cjpeg.exe" : "cjpeg"), | ||
djpeg: new BinWrappers().dest(dest).use(isWin ? "djpeg.exe" : "djpeg"), | ||
jpegtran: new BinWrappers() | ||
.dest(dest) | ||
.use(isWin ? "jpegtran.exe" : "jpegtran"), | ||
rdjpgcom: new BinWrappers() | ||
.dest(dest) | ||
.use(isWin ? "rdjpgcom.exe" : "rdjpgcom"), | ||
tjbench: new BinWrappers().dest(dest).use(isWin ? "tjbench.exe" : "tjbench"), | ||
wrjpgcom: new BinWrappers() | ||
.dest(dest) | ||
.use(isWin ? "wrjpgcom.exe" : "wrjpgcom") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
"use strict"; | ||
|
||
const binaries = require("./bin-wrapper"); | ||
const binWrappers = require("./bin-wrappers"); | ||
|
||
module.exports = { | ||
cjpeg: binaries.cjpeg.path(), | ||
djpeg: binaries.djpeg.path(), | ||
jpegtran: binaries.jpegtran.path(), | ||
rdjpgcom: binaries.rdjpgcom.path(), | ||
tjbench: binaries.tjbench.path(), | ||
wrjpgcom: binaries.wrjpgcom.path() | ||
cjpeg: binWrappers.cjpeg.path(), | ||
djpeg: binWrappers.djpeg.path(), | ||
jpegtran: binWrappers.jpegtran.path(), | ||
rdjpgcom: binWrappers.rdjpgcom.path(), | ||
tjbench: binWrappers.tjbench.path(), | ||
wrjpgcom: binWrappers.wrjpgcom.path() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters