UNPKG

spotify-now

Version:
49 lines 1.86 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const yargs_1 = (0, tslib_1.__importDefault)(require("yargs")); yargs_1.default .scriptName("spotify-now") .command("login [id] [secret]", "Login to your spotify account before making api calls.", (yargs) => { yargs .option("id", { alias: "i", describe: "The spotify client id", }) .option("secret", { alias: "s", describe: "The spotify client secret", }); }, (argv) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { const clientId = argv.id; const clientSecret = argv.secret; const { login } = yield Promise.resolve().then(() => (0, tslib_1.__importStar)(require("./login"))); login(clientId, clientSecret); })) .command("start [pins] [interval]", "Start the app.", (yargs) => { yargs .option("pins", { alias: "p", array: true, type: "number", describe: "Light up the led using the given pins(r, g, b)", }) .option("interval", { alias: "i", type: "number", describe: "Time interval between two updates. (second)", }); }, (argv) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { const pins = argv.pins; const interval = argv.interval; const { start } = yield Promise.resolve().then(() => (0, tslib_1.__importStar)(require("./start"))); start(pins, interval); })) .command("*", "", {}, () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { const { printLogo } = yield Promise.resolve().then(() => (0, tslib_1.__importStar)(require("./printLogo"))); printLogo(); })) .demandCommand() .help().argv; //# sourceMappingURL=index.js.map