-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -220,6 +220,35 @@ export const test = createTestFn(); | |
|
||
//=== | ||
|
||
// [`bmp`](https://deno.land/x/[email protected]); install (for Deno-v1.11+/[email protected]) <br> `dxi --allow-read=. --allow-write=. --allow-run=git -qf https://deno.land/x/[email protected]/cli.ts` | ||
|
||
export const haveBmpVersion = () => { | ||
try { | ||
// deno-lint-ignore no-deprecated-deno-api | ||
const process = Deno.run({ | ||
cmd: [...(isWinOS ? ['cmd', '/x/d/c'] : []), 'bmp', '--version'], | ||
stdin: 'null', | ||
stderr: 'null', | ||
stdout: 'piped', | ||
}); | ||
return Promise | ||
.all([process.status(), process.output()]) | ||
.then(([status, out]) => { | ||
// console.debug({ status: status, out: decode(out) }); | ||
return (status.success | ||
? ((decode(out)?.match(/(?:^|@)(\d+(?:[.]\d+)+)/) || [])[1]) | ||
: undefined); | ||
}) | ||
.finally(() => process.close()); | ||
} catch (_) { | ||
return Promise.resolve(undefined); | ||
} | ||
}; | ||
|
||
export const haveBmp = () => { | ||
return haveBmpVersion().then((version) => version != null); | ||
}; | ||
|
||
// [`commitlint`](https://commitlint.js.org); install (for NodeJS v12+): `npm -g install @commitlint/cli@16 @commitlint/config-conventional@16` | ||
|
||
export const haveCommitLintVersion = () => { | ||
|
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