Skip to content

Commit

Permalink
fix: improve the awareness of users to support awesomeness
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed May 9, 2019
1 parent 0e7aa12 commit 982a612
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions bin/postinstall.js
@@ -0,0 +1,19 @@
#!/usr/bin/env node

if (!process.env.SUPPRESS_SUPPORT) {
const ANSI_RESET = '\u001b[0m'
const ANSI_GREEN = '\u001b[32m'
const ANSI_YELLOW = '\u001b[33m'
const ANSI_BLUE = '\u001b[96m'
const ANSI_WHITE = '\u001b[37m'
const ANSI_BOLD = '\u001b[1m'

console.log( // eslint-disable-line
ANSI_GREEN +
'Has SweetAlert2 helped you create amazing applications?\n' +
'You can show your' + ANSI_YELLOW + ' <3 ' + ANSI_GREEN + 'and support by making a donation:\n' +
ANSI_WHITE + ' > ' +
ANSI_BLUE + ANSI_BOLD + 'https://sweetalert2.github.io/#donations\n' +
ANSI_RESET
)
}
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -61,6 +61,7 @@
"webpack": "^4.29.0"
},
"files": [
"bin",
"dist",
"src",
"sweetalert2.d.ts"
Expand Down Expand Up @@ -106,7 +107,8 @@
"check:third-party": "npm run check:unpkg && npm run check:jsdelivr && npm run check:wappalyzer",
"check:wappalyzer": "curl 'https://api.wappalyzer.com/lookup-basic/v1/?url=https%3A%2F%2Fsweetalert2.github.io' 2>&1 | grep --quiet 'SweetAlert2'",
"check:unpkg": "curl --location 'https://unpkg.com/sweetalert2' 2>&1 | grep --quiet 'window.Swal'",
"check:jsdelivr": "curl --location 'https://cdn.jsdelivr.net/npm/sweetalert2' 2>&1 | grep --quiet 'window.Swal'"
"check:jsdelivr": "curl --location 'https://cdn.jsdelivr.net/npm/sweetalert2' 2>&1 | grep --quiet 'window.Swal'",
"postinstall": "node bin/postinstall.js"
},
"bugs": "https://github.com/sweetalert2/sweetalert2/issues",
"license": "MIT"
Expand Down

0 comments on commit 982a612

Please sign in to comment.