Files
arduino-ide/electron/packager/cli
2019-05-06 10:25:29 +02:00

31 lines
1.0 KiB
JavaScript
Executable File

#!/usr/bin/env node
// @ts-check
const { versionInfo } = require('./utils');
const yargs = require('yargs');
(() => {
yargs
.command({
command: 'name',
describe: 'Returns with the application name we build. The name includes the full application name with the version, the platform and the file extension.',
handler: () => {
const { platform } = process;
let ext = undefined;
let os = undefined;
if (platform === 'darwin') {
ext = 'dmg';
os = 'mac';
} else if (platform === 'win32') {
ext = 'zip';
os = 'win';
} else {
process.stderr.write(`Unexpected platform: ${platform}.`);
process.exit(1);
}
process.stdout.write(`Arduino-PoC-${versionInfo().version}-${os}.${ext}`);
process.exit(0);
}
})
.demandCommand(1)
.argv;
})();