[enh] Init project
This commit is contained in:
30
src/dwatcher.ts
Normal file
30
src/dwatcher.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as minimist from 'minimist'
|
||||
import * as path from 'path'
|
||||
import {dwatch} from './lib/dwatch'
|
||||
|
||||
process.on('uncaughtException', (err) => {
|
||||
// Dunno why this specific exception is not caught
|
||||
console.error(err.stack || err.message || err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (err) => {
|
||||
// Dunno why this specific exception is not caught
|
||||
console.error(err.stack || err.message || err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
(async () => {
|
||||
|
||||
const argv = minimist(process.argv.slice(2))
|
||||
console.log('Starting...')
|
||||
|
||||
try {
|
||||
await dwatch(argv.conf || path.join(__dirname, '../app.yml'))
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
console.log('Finished')
|
||||
}
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user