mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-09-10 20:35:10 -05:00
Always get package root directory from src/util.ts
This commit is contained in:
@@ -6,7 +6,7 @@ import * as persist from 'node-persist';
|
|||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
import dotenvExpand from 'dotenv-expand';
|
import dotenvExpand from 'dotenv-expand';
|
||||||
import { dev, getToken, initStorage, LoopResult, paths } from '../../util.js';
|
import { dev, dir, getToken, initStorage, LoopResult, paths } from '../../util.js';
|
||||||
import MenuApp from './menu.js';
|
import MenuApp from './menu.js';
|
||||||
import { ZncDiscordPresence } from '../../cli/nso/presence.js';
|
import { ZncDiscordPresence } from '../../cli/nso/presence.js';
|
||||||
import { WebServiceIpc } from './webservices.js';
|
import { WebServiceIpc } from './webservices.js';
|
||||||
@@ -16,8 +16,7 @@ import { ErrorResponse } from '../../api/util.js';
|
|||||||
|
|
||||||
const debug = createDebug('app:main');
|
const debug = createDebug('app:main');
|
||||||
|
|
||||||
const __dirname = path.join(import.meta.url.substr(7), '..');
|
export const bundlepath = path.resolve(dir, 'dist', 'bundle');
|
||||||
export const bundlepath = path.join(import.meta.url.substr(7), '..', '..', 'bundle');
|
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import frida, { Session } from 'frida';
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import bodyParser from 'body-parser';
|
import bodyParser from 'body-parser';
|
||||||
import type { Arguments as ParentArguments } from '../cli.js';
|
import type { Arguments as ParentArguments } from '../cli.js';
|
||||||
import { ArgumentsCamelCase, Argv, getJwks, initStorage, YargsArguments } from '../util.js';
|
import { ArgumentsCamelCase, Argv, dir, getJwks, initStorage, YargsArguments } from '../util.js';
|
||||||
import { Jwt } from '../api/util.js';
|
import { Jwt } from '../api/util.js';
|
||||||
import { NintendoAccountIdTokenJwtPayload } from '../api/na.js';
|
import { NintendoAccountIdTokenJwtPayload } from '../api/na.js';
|
||||||
import { ZNCA_CLIENT_ID, ZncJwtPayload } from '../api/znc.js';
|
import { ZNCA_CLIENT_ID, ZncJwtPayload } from '../api/znc.js';
|
||||||
@@ -271,7 +271,7 @@ async function setup(argv: ArgumentsCamelCase<Arguments>) {
|
|||||||
'-s',
|
'-s',
|
||||||
argv.device,
|
argv.device,
|
||||||
'push',
|
'push',
|
||||||
path.join(import.meta.url.substr(7), '..', '..', '..', 'resources', 'android-znca-api-server.sh'),
|
path.join(dir, 'resources', 'android-znca-api-server.sh'),
|
||||||
'/data/local/tmp/android-znca-api-server.sh',
|
'/data/local/tmp/android-znca-api-server.sh',
|
||||||
], {
|
], {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
|
|||||||
@@ -3,15 +3,13 @@ import * as fs from 'fs/promises';
|
|||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
import createDebug from 'debug';
|
import createDebug from 'debug';
|
||||||
import mkdirp from 'mkdirp';
|
import mkdirp from 'mkdirp';
|
||||||
import { paths, version } from '../util.js';
|
import { dir, paths, version } from '../util.js';
|
||||||
|
|
||||||
const debug = createDebug('cli:update');
|
const debug = createDebug('cli:update');
|
||||||
|
|
||||||
const RELEASES_URL = 'https://api.github.com/repos/samuelthomas2774/nxapi/releases';
|
const RELEASES_URL = 'https://api.github.com/repos/samuelthomas2774/nxapi/releases';
|
||||||
|
|
||||||
export async function checkUpdates() {
|
export async function checkUpdates() {
|
||||||
const dir = path.resolve(import.meta.url.substr(7), '..', '..', '..');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fs.stat(path.join(dir, '.git'));
|
await fs.stat(path.join(dir, '.git'));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user