UNPKG

1.54 kBSource Map (JSON)View Raw
1{"version":3,"sources":["exit.js"],"names":["installExitHooks","projectDir","process","platform","require","createInterface","input","stdin","output","stdout","on","emit","console","log","blue","stopAsync","then","green","exit"],"mappings":";;;;;QAKgBA,gB,GAAAA,gB;;;;AAHhB;AAAA;AAAA;;;;AACA;AAAA;AAAA;;;;AAEO,SAASA,gBAAT,CAA0BC,UAA1B,EAA8C;AACnD;AACA,MAAIC,QAAQC,QAAR,KAAqB,OAAzB,EAAkC;AAChCC,YAAQ,UAAR,EACGC,eADH,CACmB;AACfC,aAAOJ,QAAQK,KADA;AAEfC,cAAQN,QAAQO;AAFD,KADnB,EAKGC,EALH,CAKM,QALN,EAKgB,YAAM;AAClBR,cAAQS,IAAR,CAAa,QAAb;AACD,KAPH;AAQD;;AAEDT,UAAQQ,EAAR,CAAW,QAAX,EAAqB,YAAM;AACzBE,YAAQC,GAAR,CAAY,kCAAMC,IAAN,CAAW,wBAAX,CAAZ;AACA,kCAAQC,SAAR,CAAkBd,UAAlB,EAA8Be,IAA9B,CAAmC,YAAM;AACvCJ,cAAQC,GAAR,CAAY,kCAAMI,KAAN,CAAY,mBAAZ,CAAZ;AACAf,cAAQgB,IAAR;AACD,KAHD;AAID,GAND;AAOD","file":"../exit.js","sourcesContent":["// @flow\n\nimport chalk from 'chalk';\nimport { Project } from 'xdl';\n\nexport function installExitHooks(projectDir: string) {\n // install ctrl+c handler that writes non-running state to directory\n if (process.platform === 'win32') {\n require('readline')\n .createInterface({\n input: process.stdin,\n output: process.stdout,\n })\n .on('SIGINT', () => {\n process.emit('SIGINT');\n });\n }\n\n process.on('SIGINT', () => {\n console.log(chalk.blue('\\nStopping packager...'));\n Project.stopAsync(projectDir).then(() => {\n console.log(chalk.green('Packager stopped.'));\n process.exit();\n });\n });\n}\n"],"sourceRoot":"/exp@57.1.1/src"}
\No newline at end of file