zip.js 637 B

1234567891011121314151617181920
  1. const { exec } = require('child_process');
  2. const path = require('path')
  3. const version = process.env.npm_package_version
  4. // Replace "ls -l" with your desired terminal command
  5. const command = 'ls -l';
  6. let exePath = path.resolve(__dirname, `../dist/Pinokio Setup ${version}.exe`)
  7. let zipPath = path.resolve(__dirname, `../dist/Pinokio-${version}-win32.zip`)
  8. exec(`zip -j "${zipPath}" "${exePath}"`, (error, stdout, stderr) => {
  9. if (error) {
  10. console.error(`Error executing command: ${error}`);
  11. return;
  12. }
  13. console.log('Command executed successfully.');
  14. console.log('stdout:', stdout);
  15. console.log('stderr:', stderr);
  16. });