mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-14 19:11:58 -06:00
This prevents SnoreToast from installing a Start Menu shortcut by specifying an appID. The appID is also used to set the notification's title bar text in Windows 10. That text is now set to "Vue UI", which replaces the default value of "SnoreToast". fixes #2720
24 lines
775 B
JavaScript
24 lines
775 B
JavaScript
const path = require('path')
|
|
const notifier = require('node-notifier')
|
|
|
|
const builtinIcons = {
|
|
done: path.resolve(__dirname, '../../src/assets/done.png'),
|
|
error: path.resolve(__dirname, '../../src/assets/error.png')
|
|
}
|
|
|
|
// https://github.com/mikaelbr/node-notifier/issues/154
|
|
// Specify appID to prevent SnoreToast shortcut installation.
|
|
// SnoreToast actually uses it as the string in the notification's
|
|
// title bar (different from title heading inside notification).
|
|
// This only has an effect in Windows.
|
|
const snoreToastOptions = notifier.Notification === notifier.WindowsToaster && { appID: 'Vue UI' }
|
|
|
|
exports.notify = ({ title, message, icon }) => {
|
|
notifier.notify({
|
|
...snoreToastOptions,
|
|
title,
|
|
message,
|
|
icon: builtinIcons[icon] || icon
|
|
})
|
|
}
|