|
| 1 | +diff --git a/node_modules/@serverless/cli/src/Context.js b/node_modules/@serverless/cli/src/Context.js |
| 2 | +index 4fb9da9..f8919a4 100644 |
| 3 | +--- a/node_modules/@serverless/cli/src/Context.js |
| 4 | ++++ b/node_modules/@serverless/cli/src/Context.js |
| 5 | +@@ -153,7 +153,11 @@ class CLI { |
| 6 | + process.stdout.write(ansiEscapes.cursorShow) |
| 7 | + if (!this.isStatusEngineActive()) { |
| 8 | + console.log() // eslint-disable-line |
| 9 | +- process.exit(0) |
| 10 | ++ if (reason === 'error') { |
| 11 | ++ process.exit(1) |
| 12 | ++ } else { |
| 13 | ++ process.exit(0) |
| 14 | ++ } |
| 15 | + return |
| 16 | + } |
| 17 | + return this.statusEngineStop(reason, message) |
| 18 | +@@ -244,44 +248,46 @@ class CLI { |
| 19 | + this._.entity = entity |
| 20 | + } |
| 21 | + |
| 22 | +- // Loading dots |
| 23 | +- if (this._.status.loadingDotCount === 0) { |
| 24 | +- this._.status.loadingDots = `.` |
| 25 | +- } else if (this._.status.loadingDotCount === 2) { |
| 26 | +- this._.status.loadingDots = `..` |
| 27 | +- } else if (this._.status.loadingDotCount === 4) { |
| 28 | +- this._.status.loadingDots = `...` |
| 29 | +- } else if (this._.status.loadingDotCount === 6) { |
| 30 | +- this._.status.loadingDots = '' |
| 31 | +- } |
| 32 | +- this._.status.loadingDotCount++ |
| 33 | +- if (this._.status.loadingDotCount > 8) { |
| 34 | +- this._.status.loadingDotCount = 0 |
| 35 | +- } |
| 36 | ++ if (process.stdout.isTTY) { |
| 37 | ++ // Loading dots |
| 38 | ++ if (this._.status.loadingDotCount === 0) { |
| 39 | ++ this._.status.loadingDots = `.` |
| 40 | ++ } else if (this._.status.loadingDotCount === 2) { |
| 41 | ++ this._.status.loadingDots = `..` |
| 42 | ++ } else if (this._.status.loadingDotCount === 4) { |
| 43 | ++ this._.status.loadingDots = `...` |
| 44 | ++ } else if (this._.status.loadingDotCount === 6) { |
| 45 | ++ this._.status.loadingDots = '' |
| 46 | ++ } |
| 47 | ++ this._.status.loadingDotCount++ |
| 48 | ++ if (this._.status.loadingDotCount > 8) { |
| 49 | ++ this._.status.loadingDotCount = 0 |
| 50 | ++ } |
| 51 | + |
| 52 | +- // Clear any existing content |
| 53 | +- process.stdout.write(ansiEscapes.eraseDown) |
| 54 | ++ // Clear any existing content |
| 55 | ++ process.stdout.write(ansiEscapes.eraseDown) |
| 56 | + |
| 57 | +- // Write content |
| 58 | +- console.log() // eslint-disable-line |
| 59 | +- let content = ' ' |
| 60 | +- if (this._.useTimer) { |
| 61 | +- content += ` ${grey(this._.seconds + 's')}` |
| 62 | +- content += ` ${grey(figures.pointerSmall)}` |
| 63 | +- } |
| 64 | ++ // Write content |
| 65 | ++ console.log() // eslint-disable-line |
| 66 | ++ let content = ' ' |
| 67 | ++ if (this._.useTimer) { |
| 68 | ++ content += ` ${grey(this._.seconds + 's')}` |
| 69 | ++ content += ` ${grey(figures.pointerSmall)}` |
| 70 | ++ } |
| 71 | + |
| 72 | +- content += ` ${this._.entity}` |
| 73 | +- content += ` ${grey(figures.pointerSmall)} ${grey(this._.status.message)}` |
| 74 | +- content += ` ${grey(this._.status.loadingDots)}` |
| 75 | +- process.stdout.write(content) |
| 76 | +- console.log() // eslint-disable-line |
| 77 | ++ content += ` ${this._.entity}` |
| 78 | ++ content += ` ${grey(figures.pointerSmall)} ${grey(this._.status.message)}` |
| 79 | ++ content += ` ${grey(this._.status.loadingDots)}` |
| 80 | ++ process.stdout.write(content) |
| 81 | ++ console.log() // eslint-disable-line |
| 82 | + |
| 83 | +- // Get cursor starting position according to terminal & content width |
| 84 | +- const startingPosition = this.getRelativeVerticalCursorPosition(content) |
| 85 | ++ // Get cursor starting position according to terminal & content width |
| 86 | ++ const startingPosition = this.getRelativeVerticalCursorPosition(content) |
| 87 | + |
| 88 | +- // Put cursor to starting position for next view |
| 89 | +- process.stdout.write(ansiEscapes.cursorUp(startingPosition)) |
| 90 | +- process.stdout.write(ansiEscapes.cursorLeft) |
| 91 | ++ // Put cursor to starting position for next view |
| 92 | ++ process.stdout.write(ansiEscapes.cursorUp(startingPosition)) |
| 93 | ++ process.stdout.write(ansiEscapes.cursorLeft) |
| 94 | ++ } |
| 95 | + } |
| 96 | + |
| 97 | + renderLog(msg) { |
| 98 | +diff --git a/node_modules/@serverless/cli/src/index.js b/node_modules/@serverless/cli/src/index.js |
| 99 | +index ee52b08..9652a4e 100644 |
| 100 | +--- a/node_modules/@serverless/cli/src/index.js |
| 101 | ++++ b/node_modules/@serverless/cli/src/index.js |
| 102 | +@@ -233,11 +233,9 @@ const runComponents = async (serverlessFileArg) => { |
| 103 | + } |
| 104 | + } |
| 105 | + context.close('done') |
| 106 | +- process.exit(0) |
| 107 | + } catch (e) { |
| 108 | + context.renderError(e) |
| 109 | + context.close('error', e) |
| 110 | +- process.exit(1) |
| 111 | + } |
| 112 | + } |
| 113 | + |
0 commit comments