UNPKG

node-talisman

Version:

A npm package for running Thoughtwork's Talisman tool

37 lines (35 loc) 805 B
import messages from "../messages.js"; import { logToConsoleForDebugging } from "../utils/logToConsole.js"; import download from "./download.js"; import verifyChecksum from "./verifyChecksum.js"; import writeFile from "./writeFile.js"; import makeExecutable from "./makeExecutable.js"; const install = ({ url, checksum, fileBasePath, fileName, filePath }) => { logToConsoleForDebugging({ url, checksum, fileBasePath, fileName, filePath }); return download({ url, name: messages.binary.toString() }).then(data => verifyChecksum({ data, checksum }).then(() => data)).then(data => writeFile({ fileBasePath, filePath, data }).then(() => data)).then(data => makeExecutable({ filePath }).then(() => data)); }; export default install;