mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-07-18 16:32:17 -05:00
Use NXAPI_DATA_PATH and ZNC_PROXY_URL environment variables
This commit is contained in:
parent
f1d262bfa7
commit
d5cf1b87a8
|
|
@ -8,7 +8,7 @@ const debug = createDebug('cli');
|
|||
const yargs = Yargs(process.argv.slice(2)).option('data-path', {
|
||||
describe: 'Data storage path',
|
||||
type: 'string',
|
||||
default: paths.data,
|
||||
default: process.env.NXAPI_DATA_PATH || paths.data,
|
||||
});
|
||||
|
||||
export type Arguments = YargsArguments<typeof yargs>;
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@ export const desc = 'Nintendo Switch Online';
|
|||
|
||||
export function builder(yargs: Argv<ParentArguments>) {
|
||||
for (const command of Object.values(commands)) {
|
||||
// @ts-expect-error
|
||||
// @ts-ignore
|
||||
yargs.command(command);
|
||||
}
|
||||
|
||||
return yargs.option('znc-proxy-url', {
|
||||
describe: 'URL of Nintendo Switch Online app API proxy server to use',
|
||||
type: 'string',
|
||||
default: process.env.ZNC_PROXY_URL,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export async function handler(argv: ArgumentsCamelCase<Arguments>) {
|
|||
console.log('');
|
||||
console.log(authoriseurl);
|
||||
console.log('');
|
||||
|
||||
|
||||
console.log('2. On the "Linking an External Account" page, right click "Select this person" and copy the link. It should start with "npf71b963c1b7b6d119://auth".');
|
||||
console.log('');
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ export async function handler(argv: ArgumentsCamelCase<Arguments>) {
|
|||
|
||||
if (argv.auth) {
|
||||
const storage = await initStorage(argv.dataPath);
|
||||
|
||||
|
||||
const {nso, data} = await getToken(storage, token.session_token, argv.zncProxyUrl);
|
||||
|
||||
console.log('Authenticated as Nintendo Account %s (NA %s, NSO %s)',
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export async function handler(argv: ArgumentsCamelCase<Arguments>) {
|
|||
console.log('');
|
||||
console.log(authoriseurl);
|
||||
console.log('');
|
||||
|
||||
|
||||
console.log('2. On the "Linking an External Account" page, right click "Select this person" and copy the link. It should start with "npf54789befb391a838://auth".');
|
||||
console.log('');
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ export async function handler(argv: ArgumentsCamelCase<Arguments>) {
|
|||
|
||||
if (argv.auth) {
|
||||
const storage = await initStorage(argv.dataPath);
|
||||
|
||||
|
||||
const {moon, data} = await getPctlToken(storage, token.session_token);
|
||||
|
||||
console.log('Authenticated as Nintendo Account %s (%s)',
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ export function builder(yargs: Argv<ParentArguments>) {
|
|||
return yargs.option('znc-proxy-url', {
|
||||
describe: 'URL of Nintendo Switch Online app API proxy server to use',
|
||||
type: 'string',
|
||||
default: process.env.ZNC_PROXY_URL,
|
||||
}).option('auto-update-session', {
|
||||
alias: ['auto-update-iksm-session'],
|
||||
describe: 'Automatically obtain and refresh the iksm_session cookie',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user