setup-cpp/dev/scripts/debug_remove.js

18 lines
570 B
JavaScript
Raw Permalink Normal View History

2022-01-23 09:41:18 +08:00
/* eslint-disable import/no-extraneous-dependencies */
const { minify } = require("terser")
const { readFileSync, writeFileSync } = require("fs")
const { join, dirname } = require("path")
async function main() {
console.log("Disabling debug messages inside @actions/core")
const file = join(dirname(__dirname), "dist", "setup-cpp.js")
const { code, map } = await minify(readFileSync(file, "utf8"), { sourceMap: true, ...require("../.terserrc.js") })
writeFileSync(file, code)
writeFileSync(`${file}.map`, map)
}
main().catch(function (err) {
throw err
})