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 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
- // 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
- })
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiro-notes",
3
- "version": "0.27.47",
3
+ "version": "0.27.48",
4
4
  "description": "Tiro Notes CLI to start Tiro Notes from the command line!",
5
5
  "scripts": {
6
6
  "dev": "ISDEV=true node cli.js",
@@ -69,10 +69,25 @@ const execCmd = (cmd, params, p) => {
69
69
  return child;
70
70
  }
71
71
 
72
- const killPreviousInstances = () => {
73
- execCmd('sh', ['-c', 'kill $(ps aux | grep tiro-server.js | awk \'{print $2}\' )'], {
74
- logName: 'Kill prev tiroServer',
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 = {