fullstacked 0.12.0-1308 → 0.12.0-1310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -141,9 +141,13 @@ function deserializeArgs(data) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
// src/webview.ts
|
|
144
|
+
var mainPort = parseInt(getEnvVar("port"));
|
|
145
|
+
if (!mainPort || isNaN(mainPort)) {
|
|
146
|
+
mainPort = 9e3;
|
|
147
|
+
}
|
|
144
148
|
var te2 = new TextEncoder();
|
|
145
149
|
async function createWebView(instance, onClose, onFirstConnection) {
|
|
146
|
-
const port = await getNextAvailablePort();
|
|
150
|
+
const port = await getNextAvailablePort(mainPort);
|
|
147
151
|
const server = http.createServer(createHandler(instance));
|
|
148
152
|
const close = () => {
|
|
149
153
|
if (onClose) {
|
|
@@ -668,14 +672,20 @@ var deeplinkMessaged = false;
|
|
|
668
672
|
if (process.argv.at(-1).startsWith("http")) {
|
|
669
673
|
deeplink = process.argv.at(-1);
|
|
670
674
|
}
|
|
671
|
-
function
|
|
675
|
+
function getEnvVar(arg) {
|
|
672
676
|
const envFlag = `FULLSTACKED_${arg.toUpperCase()}`;
|
|
673
677
|
if (typeof process.env[envFlag] === "string") {
|
|
674
678
|
return process.env[envFlag];
|
|
675
679
|
}
|
|
676
680
|
const indexOfArg = process.argv.indexOf(`--${arg}`);
|
|
677
|
-
if (indexOfArg === -1) return
|
|
678
|
-
|
|
681
|
+
if (indexOfArg === -1) return null;
|
|
682
|
+
return process.argv.at(indexOfArg + 1);
|
|
683
|
+
}
|
|
684
|
+
function parseArgsForPath(arg, fallback = process.cwd()) {
|
|
685
|
+
const definedPath = getEnvVar(arg);
|
|
686
|
+
if (!definedPath) {
|
|
687
|
+
return fallback;
|
|
688
|
+
}
|
|
679
689
|
if (definedPath.startsWith("~/")) {
|
|
680
690
|
return path4.resolve(os3.homedir(), definedPath.slice(2));
|
|
681
691
|
} else if (definedPath.startsWith("/")) {
|
|
@@ -734,5 +744,6 @@ webViews.set(mainInstanceId, mainInstanceWebView);
|
|
|
734
744
|
);
|
|
735
745
|
export {
|
|
736
746
|
cbListener,
|
|
747
|
+
getEnvVar,
|
|
737
748
|
platform
|
|
738
749
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fullstacked",
|
|
3
|
-
"version": "0.12.0-
|
|
3
|
+
"version": "0.12.0-1310",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "node build.js",
|
|
6
6
|
"start": "npm run build && node index.js --lib ../../core/bin --root ~/FullStacked --config ~/.config/fullstacked --editor ../../out/editor",
|