shellcheck
Version:
Wrapper to download shellcheck
19 lines (18 loc) • 532 B
JavaScript
import process from 'node:process';
import { config } from "../configs/index.js";
import { PlatformError } from "../errors/index.js";
/**
* Convert platform to ShellCheck archive.
*
* @param args - Arguments.
* @returns ShellCheck archive.
*/
export function shellCheckArchive(args) {
const opts = {
platform: args?.platform ?? process.platform,
};
const archive = config.binaries[opts.platform]?.archive;
if (archive === undefined)
throw new PlatformError(opts.platform);
return archive;
}