tiro-notes 0.27.46 → 0.27.49

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.
@@ -69,9 +69,31 @@ const execCmd = (cmd, params, p) => {
69
69
  return child;
70
70
  }
71
71
 
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', '"ps -ef | grep \'tiro-server.js\' | grep -v grep | awk \'{print $2}\' | xargs -r kill -9"'], {
83
+
84
+ logName: 'Kill prev tiroServer',
85
+ onLog: () => {
86
+ if (!cb1) return
87
+ cb1 = false;
88
+ cb()
89
+ }
90
+ })
91
+ }
92
+ }
72
93
 
73
94
  const e = {
74
95
  checkAndGetTiroConfig,
96
+ killPreviousInstances,
75
97
  execCmd
76
98
  }
77
99