tiro-notes 0.27.24 → 0.27.27

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
@@ -53,28 +53,24 @@ const startSshTunnel = (argsObj) => {
53
53
  if (argsObj.tunnel.enabled) {
54
54
  // kill previous autossh processes
55
55
  let cb1 = true
56
- let cb2 = true
57
56
  tHelpers.execCmd('killall', [`autossh`], {
58
- logName:'tunnel 1'
59
- onLog: str => {
60
- if (!cb1) return
61
- cb1 = false
62
-
57
+ logName:'tunnel 1/3',
58
+ onDone: () => {
59
+ // check if autossh is working
63
60
  tHelpers.execCmd('autossh', [`--help`], {
64
- logName:'tunnel 2'
61
+ logName:'tunnel 2/3',
65
62
  onLog: str => {
66
- if (!cb2) return
67
- cb2 = false
68
- tHelpers.execCmd('autossh',['-M','20000','-N', argsObj.tunnel.remoteUrl,'-R', `${argsObj.tunnel.remotePort}:localhost:${argsObj.port}`,'-C'], {logName:'tunnel 3'})
63
+ if (!cb1) return
64
+ cb1 = false
65
+ // start autossh finally
66
+ tHelpers.execCmd('autossh',['-M','20000','-N', argsObj.tunnel.remoteUrl,'-R', `${argsObj.tunnel.remotePort}:localhost:${argsObj.port}`,'-C'], {
67
+ logName:'tunnel 3/3'
68
+ })
69
69
  }
70
70
  })
71
-
72
71
  }
73
- }
74
- })
75
-
76
- // check if autossh is working
77
-
72
+ })
73
+ }
78
74
  }
79
75
 
80
76
  // Main script
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiro-notes",
3
- "version": "0.27.24",
3
+ "version": "0.27.27",
4
4
  "description": "Tiro Notes for CLI",
5
5
  "scripts": {
6
6
  "clean-previous-build": "rm -r node-build",
@@ -45,7 +45,7 @@ const execCmd = (cmd, params, p) => {
45
45
  if (!p) p = {}
46
46
  if (!p.env) p.env = {}
47
47
  if (!p.platform) p.platform = false
48
- if (!p.logName) p.logName = ''
48
+ p.logName = !p.logName ? '' : `${p.logName}`
49
49
  const log = whichLog(p);
50
50
 
51
51
  log(`ExecCMD ${JSON.stringify({cmd, params, p})}`);
@@ -64,7 +64,7 @@ const execCmd = (cmd, params, p) => {
64
64
  const str = `[${p.logName} ${cmd} ERROR!] : ${data}`;
65
65
  log( str );
66
66
  });
67
- log(`ExecCMD SUCCESS ${JSON.stringify({cmd, params, p})}`);
67
+ if (p && p.onDone) p.onDone()
68
68
  return child;
69
69
  }
70
70