tiro-notes 0.27.47 → 0.27.48
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/cli.js +15 -13
- package/package.json +1 -1
- package/shared.helpers.build.js +19 -4
package/cli.js
CHANGED
|
@@ -76,19 +76,21 @@ function startTiroServer (argsObj, cb) {
|
|
|
76
76
|
console.log(`Starting Tiro-Notes from CLI with following arguments : ${JSON.stringify(argsObj)}`);
|
|
77
77
|
|
|
78
78
|
// kill all possible remaining servers of tiro
|
|
79
|
-
tHelpers.killPreviousInstances()
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
tHelpers.killPreviousInstances(() => {
|
|
80
|
+
|
|
81
|
+
// start tiro server, detect success message and get server params
|
|
82
|
+
tHelpers.execCmd('node', [`${__dirname}/server/tiro-server.js`], {
|
|
83
|
+
env: {
|
|
84
|
+
TIRO_PORT: argsObj.port,
|
|
85
|
+
TIRO_HTTPS: argsObj.https
|
|
86
|
+
},
|
|
87
|
+
logName: 'tiroServer',
|
|
88
|
+
onLog: str => {
|
|
89
|
+
tHelpers.checkAndGetTiroConfig(str, {platform: 'cli', cb})
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
});
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
const startSshTunnel = (argsObj) => {
|
package/package.json
CHANGED
package/shared.helpers.build.js
CHANGED
|
@@ -69,10 +69,25 @@ const execCmd = (cmd, params, p) => {
|
|
|
69
69
|
return child;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const killPreviousInstances = () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const killPreviousInstances = (cb) => {
|
|
73
|
+
if (!cb) cb = () => {}
|
|
74
|
+
|
|
75
|
+
// LINUX / MAC => unix like
|
|
76
|
+
const isWin = process.platform.startsWith('win');
|
|
77
|
+
|
|
78
|
+
if (isWin) {
|
|
79
|
+
cb()
|
|
80
|
+
} else {
|
|
81
|
+
let cb1 = true;
|
|
82
|
+
execCmd('sh', ['-c', 'kill $(ps aux | grep tiro-server.js | awk \'{print $2}\' )'], {
|
|
83
|
+
logName: 'Kill prev tiroServer',
|
|
84
|
+
onLog: () => {
|
|
85
|
+
if (!cb1) return
|
|
86
|
+
cb1 = false;
|
|
87
|
+
cb()
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
}
|
|
76
91
|
}
|
|
77
92
|
|
|
78
93
|
const e = {
|