You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
motief/packages/@ansible/example/tests/_pack_helpers.js

11 lines
450 B

const { execSync } = require('child_process');
const path = require('path');
module.exports.runPack = function runPack() {
const cwd = path.join(__dirname, '..');
// run npm pack and capture output
const out = execSync('npm pack', { cwd, encoding: 'utf8' }).trim();
// npm pack prints the filename on the last line
const lines = out.split(/\r?\n/).filter(Boolean);
const filename = lines[lines.length - 1];
return { cwd, filename };
};