-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a lightweight Typescript wrapper and bootstrapper to for binary CLI executables
- Loading branch information
1 parent
5219680
commit 575cb36
Showing
13 changed files
with
844 additions
and
52 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
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
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
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,3 @@ | ||
const { createJestConfig } = require('../test/createJestConfig'); | ||
|
||
module.exports = createJestConfig({ displayName: 'ts-binary-wrapper' }); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,39 @@ | ||
{ | ||
"name": "ts-binary-wrapper", | ||
"version": "1.0.0", | ||
"description": "Wrapper for Snyk's Golang based Extensible CLI.", | ||
"main": "dist/index.js", | ||
"directories": { | ||
"lib": "src", | ||
"test": "test" | ||
}, | ||
"bin": { | ||
"snyk": "dist/index.js" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"scripts": { | ||
"clean": "npx rimraf dist tsconfig.tsbuildinfo src/generated", | ||
"build": "tsc && cp -R src/generated dist/", | ||
"test": "npx jest test/*", | ||
"postinstall": "node dist/bootstrap.js exec" | ||
}, | ||
"keywords": [ | ||
"security", | ||
"vulnerabilities", | ||
"advisories", | ||
"audit", | ||
"snyk", | ||
"scan", | ||
"docker", | ||
"container", | ||
"scanning" | ||
], | ||
"author": "snyk.io", | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/snyk/snyk.git" | ||
} | ||
} |
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,18 @@ | ||
import * as common from './common'; | ||
import * as process from 'process'; | ||
|
||
const config = common.getCurrentConfiguration(); | ||
export const executable = config.getLocalLocation(); | ||
|
||
if (process.argv.includes('exec')) { | ||
const filenameShasum = config.getShasumFile(); | ||
const downloadUrl = config.getDownloadLocation(); | ||
|
||
common | ||
.downloadExecutable(downloadUrl, executable, filenameShasum) | ||
.then(process.exit) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); | ||
} |
Oops, something went wrong.