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 0000000000..844970e622 Binary files /dev/null and b/packages/@vue/cli-ui/src/assets/done.png differ diff --git a/packages/@vue/cli-ui/src/assets/error.png b/packages/@vue/cli-ui/src/assets/error.png new file mode 100644 index 0000000000..335e6b4929 Binary files /dev/null and b/packages/@vue/cli-ui/src/assets/error.png differ 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')) } }