Commit ce817b0cf3f5feaa9f053f54ebdccc54045c6a4a

Authored by Adhidarma Hadiwinoto
1 parent e5c735315b
Exists in master

Simplifikasi process.title

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

1 1 'use strict';
2 2  
3 3 process.chdir(__dirname);
4   -const fs = require('fs')
  4 +const fs = require('fs');
5 5  
6 6 fs.writeFileSync('pid.txt', process.pid);
7 7  
8 8 const path = require('path');
9 9 const config = require('komodo-sdk/config');
10 10  
11   -process.title = `KOMODO-MODEM@${(typeof config.name === 'string') ? config.name.toUpperCase() : path.basename(config.modem.device).toUpperCase()}`;
  11 +process.title = (typeof config.name === 'string') ? config.name.toUpperCase() : `MODEM-${path.basename(config.modem.device).replace('tty', '').toUpperCase()}`;
  12 +
12 13 if (!fs.existsSync(config.modem.device)) {
13 14 process.exit(4);
14 15 }