From 0335d325acaf795ef47ddd10fe32ccd5f34eb7e7 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Tue, 17 Apr 2018 02:53:23 +0200 Subject: [PATCH] feat(ui): Task notifs --- packages/@vue/cli-ui/package.json | 1 + packages/@vue/cli-ui/src/assets/done.png | Bin 0 -> 1784 bytes packages/@vue/cli-ui/src/assets/error.png | Bin 0 -> 1435 bytes .../cli-ui/src/graphql-api/connectors/tasks.js | 13 +++++++++++++ 4 files changed, 14 insertions(+) create mode 100644 packages/@vue/cli-ui/src/assets/done.png create mode 100644 packages/@vue/cli-ui/src/assets/error.png diff --git a/packages/@vue/cli-ui/package.json b/packages/@vue/cli-ui/package.json index 33ec5b6ca9..aa808bebda 100644 --- a/packages/@vue/cli-ui/package.json +++ b/packages/@vue/cli-ui/package.json @@ -31,6 +31,7 @@ "lowdb": "^1.0.0", "lru-cache": "^4.1.2", "mkdirp": "^0.5.1", + "node-notifier": "^5.2.1", "rimraf": "^2.6.2", "semver": "^5.5.0", "shortid": "^2.2.8", diff --git a/packages/@vue/cli-ui/src/assets/done.png b/packages/@vue/cli-ui/src/assets/done.png new file mode 100644 index 0000000000000000000000000000000000000000..844970e622ac4d93b475e1f7f21a24fe95f8310c GIT binary patch literal 1784 zcmVd+#O$XzC zL1F@f#||1nJxqKajN?rDh!DQceM`&E;c#R2b0Nm?^CIcr3*rokydrLr`^+IzP&jL^wmlMQ*Q4Yo{ z0LFNwn?w)5JB0ApM8lgdcp>OX0D_G*t3kXCK!F!}HaJbhZ|sXyewL|FMgb_Pm*XxQ z#>WIalc^yt`L=(+SK7Ax>*rTn8XjUptEpy%*pI-D-HmQ6aD*8m{Pa)7e!3LJd`q zGEqGU6W#RB0_T}{MLbgZqtlL#0}yJcTEK#uk-de^Exim5#fvI`a?;6B00z@uwF0=q zk!iW(Zy~VA$#k$CfWo+(Ao_g=M!=j;$I*PH<}@sm7wt3_c2$jjvGW#i9ss8H8OBb# zjco-W*jTfgK~K52DI3tQ0RFM4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m_hFY1`h#%pYh@mTEB!qBpXx`^8)XX$NnyOS@VW1npYE5C!64Aj*rLu2TU*DLfm;em_Wu|1? zn~Av#L|XwUcV~mUqYuo7S%{vj>mFS&f0+ql#BpvR-(OFbbtf~g22smDTW~}ZU>+l) pKctjrAVe`}4X;6i1`Qf$HJVZs0a002ovPDHLkV1iDEhvonP literal 0 HcmV?d00001 diff --git a/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js b/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js index 8c17f0d846..f24d7c5ede 100644 --- a/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js +++ b/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js @@ -1,5 +1,7 @@ +const path = require('path') const execa = require('execa') const terminate = require('terminate') +const notifier = require('node-notifier') // Subs const channels = require('../channels') // Connectors @@ -295,6 +297,11 @@ function run (id, context) { message: `Task ${task.id} ended with error code ${code}`, type: 'error' }, context) + notifier.notify({ + title: `Task error`, + message: `Task ${task.id} ended with error code ${code}`, + icon: path.resolve(__dirname, '../../assets/error.png') + }) } else { updateOne({ id: task.id, @@ -305,6 +312,12 @@ function run (id, context) { message: `Task ${task.id} completed`, type: 'done' }, context) + notifier.notify({ + title: `Task completed`, + message: `Task ${task.id} completed`, + icon: path.resolve(__dirname, '../../assets/done.png') + }) + console.log(path.resolve(__dirname, '../../assets/done.png')) } }