mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Add scripts for running the nxapi command using the app Electron binary
This commit is contained in:
parent
584f0e2d89
commit
eda75b4dee
20
README.md
20
README.md
|
|
@ -64,17 +64,25 @@ nxapi includes an Electron app, which can be downloaded [here](https://github.co
|
|||
|
||||

|
||||
|
||||
The app includes the nxapi command line at `dist/bundle/cli-bundle.js`. Node.js must be installed separately to use this.
|
||||
The app includes the nxapi command line at `dist/bundle/cli-bundle.js`.
|
||||
|
||||
```sh
|
||||
# macOS
|
||||
node Nintendo\ Switch\ Online.app/Contents/Resources/app/dist/bundle/cli-bundle.js ...
|
||||
|
||||
# Windows
|
||||
node 'Nintendo Switch Online/resources/app/dist/bundle/cli-bundle.js' ...
|
||||
Nintendo\ Switch\ Online.app/Contents/bin/nxapi
|
||||
|
||||
# Linux, installed via dpkg
|
||||
node /opt/Nintendo\ Switch\ Online/resources/app/dist/bundle/cli-bundle.js ...
|
||||
# This is linked as /usr/bin/nxapi
|
||||
/opt/Nintendo\ Switch\ Online/bin/nxapi
|
||||
```
|
||||
|
||||
On Windows, Node.js must be installed separately.
|
||||
|
||||
```powershell
|
||||
# PowerShell
|
||||
node $env:LOCALAPPDATA\Programs\nxapi-app\resources\app\dist\bundle\cli-bundle.js ...
|
||||
|
||||
# Command Prompt
|
||||
node %localappdata%\Programs\nxapi-app\resources\app\dist\bundle\cli-bundle.js ...
|
||||
```
|
||||
|
||||
#### Do I need a Nintendo Switch Online membership?
|
||||
|
|
|
|||
20
package.json
20
package.json
|
|
@ -87,7 +87,7 @@
|
|||
"build": {
|
||||
"appId": "uk.org.fancy.nxapi.app",
|
||||
"productName": "Nintendo Switch Online",
|
||||
"copyright": "Copyright © 2022 Samuel Elliott",
|
||||
"copyright": "Copyright © 2023 Samuel Elliott",
|
||||
"npmRebuild": false,
|
||||
"files": [
|
||||
"dist/app/bundle",
|
||||
|
|
@ -130,7 +130,25 @@
|
|||
}
|
||||
],
|
||||
"mac": {
|
||||
"extraFiles": [
|
||||
{
|
||||
"from": "resources/build/app/cli-macos.sh",
|
||||
"to": "bin/nxapi"
|
||||
}
|
||||
],
|
||||
"identity": null
|
||||
},
|
||||
"linux": {
|
||||
"extraFiles": [
|
||||
{
|
||||
"from": "resources/build/app/cli-linux.sh",
|
||||
"to": "nxapi"
|
||||
}
|
||||
]
|
||||
},
|
||||
"deb": {
|
||||
"afterInstall": "resources/build/app/deb/postinst",
|
||||
"afterRemove": "resources/build/app/deb/postrm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
resources/build/app/cli-linux.sh
Executable file
8
resources/build/app/cli-linux.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Run as /opt/Nintendo Switch Online/nxapi
|
||||
|
||||
APP_BUNDLE_PATH="$(dirname "$0")"
|
||||
export ELECTRON_RUN_AS_NODE=1
|
||||
|
||||
exec "$APP_BUNDLE_PATH/nxapi-app" "$APP_BUNDLE_PATH/resources/app/dist/bundle/cli-bundle.js" $@
|
||||
8
resources/build/app/cli-macos.sh
Executable file
8
resources/build/app/cli-macos.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Run as Nintendo Switch Online.app/Contents/bin/nxapi
|
||||
|
||||
APP_BUNDLE_PATH="$(dirname "$0")/../.."
|
||||
export ELECTRON_RUN_AS_NODE=1
|
||||
|
||||
exec "$APP_BUNDLE_PATH/Contents/MacOS/Nintendo Switch Online" "$APP_BUNDLE_PATH/Contents/Resources/app/dist/bundle/cli-bundle.js" $@
|
||||
12
resources/build/app/deb/postinst
Executable file
12
resources/build/app/deb/postinst
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
ln -sf '/opt/Nintendo Switch Online/nxapi' '/usr/bin/nxapi'
|
||||
|
||||
# Link to the binary
|
||||
ln -sf '/opt/Nintendo Switch Online/nxapi-app' '/usr/bin/nxapi-app'
|
||||
|
||||
# SUID chrome-sandbox for Electron 5+
|
||||
chmod 4755 '/opt/Nintendo Switch Online/chrome-sandbox' || true
|
||||
|
||||
update-mime-database /usr/share/mime || true
|
||||
update-desktop-database /usr/share/applications || true
|
||||
6
resources/build/app/deb/postrm
Executable file
6
resources/build/app/deb/postrm
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm -f '/usr/bin/nxapi'
|
||||
|
||||
# Delete the link to the binary
|
||||
rm -f '/usr/bin/nxapi-app'
|
||||
|
|
@ -106,6 +106,7 @@ const main = {
|
|||
}),
|
||||
],
|
||||
external: [
|
||||
'electron',
|
||||
'node-notifier',
|
||||
'register-scheme',
|
||||
'bindings',
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const USER_AGENT_INFO_URL = 'https://gitlab.fancy.org.uk/samuel/nxapi#use
|
|||
export const CONFIG_URL = 'https://fancy.org.uk/api/nxapi/config';
|
||||
|
||||
export const LICENCE_NOTICE = `
|
||||
Copyright (c) 2022 Samuel Elliott
|
||||
Copyright (c) 2023 Samuel Elliott
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user