-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- feat: improve 3rd-party license gathering - feat: add CLI wrapper - tests: improve tests - docs: improve docs - build: add dist-build closes #55 - since the installable package includes a CLI wrapper --------- Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
- Loading branch information
1 parent
272e2ce
commit 088301f
Showing
11 changed files
with
330 additions
and
189 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
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,33 @@ | ||
#!/usr/bin/env node | ||
/* !!! do not remove/rename this file, it is public CLI in replacement for an API !!! */ | ||
|
||
const { spawn } = require('child_process') | ||
const { realpathSync } = require('fs') | ||
const { join } = require('path') | ||
|
||
let pp | ||
for (const p of [ | ||
['yarn-plugin-cyclonedx.cjs'], // running in pack | ||
['dist', 'yarn-plugin-cyclonedx.cjs'], // running in dist | ||
['bundles', '@yarnpkg', 'plugin-cyclonedx.js'] // running in build | ||
]) { | ||
try { | ||
pp = realpathSync(join(__dirname, '..', ...p)) | ||
break | ||
} catch { | ||
/* pass */ | ||
} | ||
} | ||
if (!pp) { | ||
throw Error('missing plugin') | ||
} | ||
|
||
const YARN_PLUGINS = `${pp}${process.env.YARN_PLUGINS ? ';' + process.env.YARN_PLUGINS : ''}` | ||
const args = ['cyclonedx', ...process.argv.splice(2)] | ||
|
||
process.stderr.write(`\n> YARN_PLUGINS='${YARN_PLUGINS}' yarn ${args.join(' ')}\n\n`) | ||
spawn('yarn', args, { | ||
stdio: 'inherit', | ||
env: { ...process.env, YARN_PLUGINS }, | ||
shell: process.platform === 'win32' | ||
}).once('exit', code => { process.exitCode = code }) |
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
Oops, something went wrong.